[Botan-devel] Encrypt key object?

Jack Lloyd lloyd at randombit.net
Thu Dec 1 10:04:13 EST 2005


Actually the easiest thing to do is to use:

X509::encode(const X509_PublicKey&, Pipe&, X509_Encoding = PEM);

Something like:

RSA_PublicKey rsa_key = /* initialized somehow */
Pipe pipe(/*encryption filters*/);
X509::encode(rsa_key, pipe, RAW_BER);

By default X509::encode defaults to PEM output (which is base64 encoded with
some headers attached), but using that format doesn't make a huge amount of
sense considering you're going to be encrypting it anyway, so the output would
be larger with no gain.

-J

On Thu, Dec 01, 2005 at 04:41:23AM -0500, Ghalib - wrote:
> Hi Jack, I have to use a crypto lib for a project at school, picked Botan :)
> 
> I need to encrypt an RSA public key using AES...I'm using pipes, and
> so I need to pass in my public key to Pipe::write() as a
> SecureVector<byte>, an std::string, or a DataSource. What's the
> easiest way to go from an RSA_PublicKey object to one of these?
> 
> -Ghalib
> _______________________________________________
> botan-devel mailing list
> botan-devel at randombit.net
> http://www.randombit.net/mailman/listinfo/botan-devel



More information about the botan-devel mailing list