[botan-devel] PEM_encode and ECDH_PrivateKey

Sean Cassidy sean.a.cassidy at gmail.com
Fri Feb 3 16:04:25 EST 2012


On Wed, Feb 1, 2012 at 3:11 PM, Jack Lloyd <lloyd at randombit.net> wrote:
> Either of the first two cases you can do in your application code
> right now. For instance to use the ECDSA OID, add this to your main
> right after LibraryInitializer runs:
>
>   Library_State& botan_state = global_state();
>   const std::string ecdh_oid = "1.2.840.10045.2.1";
>
>   if(!botan_state.is_set("oid2str", ecdh_oid))
>      botan_state.set("oid2str", ecdh_oid, "ECDH");
>
>   if(!botan_state.is_set("str2oid", "ECDH"))
>      botan_state.set("str2oid", "ECDH", ecdh_oid);
>
> The same approach could be used for the 1.3.132.1.12 OID.

It looks like this isn't the only thing necessary if you use the
1.3.132.1.12 OID. As make_private_key actually needs to call the
ECDH_PrivateKey constructor, this needs to be added to make load_key
function properly. Attached is a patch if you decide to go the
1.3.132.1.12 OID route. Works on 1.10.1 and latest mtn sources.

Cheers,
Sean
-------------- next part --------------
A non-text attachment was scrubbed...
Name: botan-ecdh.patch
Type: text/x-patch
Size: 1601 bytes
Desc: not available
URL: <http://lists.randombit.net/pipermail/botan-devel/attachments/20120203/205d1082/attachment.bin>


More information about the botan-devel mailing list