[botan-devel] PEM_encode and ECDH_PrivateKey

Sean Cassidy sean.a.cassidy at gmail.com
Wed Feb 1 17:27:12 EST 2012


Slight typo in this example. It should have been ECDH_PrivateKey:

LibraryInitializer botan;
AutoSeeded_RNG rng;
ECDH_PrivateKey key(rng, EC_Group(OIDS::lookup("secp521r1")));
//RSA_PrivateKey key(rng, 1024); // works
//GOST_3410_PrivateKey key(rng, EC_Group(OIDS::lookup("secp521r1"))); // works
cout << PKCS8::PEM_encode(key) << endl;

Sean

On Wed, Feb 1, 2012 at 2:11 PM, Sean Cassidy <sean.a.cassidy at gmail.com> wrote:
> Hello,
>
> I don't think the OID for ECDH is properly configured.
> OIDS::lookup("ECDH"), the algorithm name given in ecdh.h, results in
> an exception. Here is some code that exhibits this problem in v1.10.1
> on Ubuntu:
>
> LibraryInitializer botan;
> AutoSeeded_RNG rng;
> DH_PrivateKey key(rng, EC_Group(OIDS::lookup("secp521r1")));
> //RSA_PrivateKey key(rng, 1024); // works
> //GOST_3410_PrivateKey key(rng, EC_Group(OIDS::lookup("secp521r1"))); // works
> cout << PKCS8::PEM_encode(key) << endl;
>
> Is this a bug?
> Thanks,
> Sean



More information about the botan-devel mailing list