On Fri, Jul 15, 2011, Kenneth Goldman wrote:

> I have to extract a binary (unsigned char *) representation of a public 
> key from an ECDSA openssl key structure.  Later, I want to use that binary 
> to reconstruct an openssl public key structure that I can use to verify a 
> signature.  The curve is fixed - P521.
> 
> I don't need any certificates, just a public key that I can embed in the 
> verifier.
> 
> Can someone point me toward sample code?  Or, can someone give me some 
> hints?
> 

One way that works with all key types is to encode as a SubjectPublicKeyInfo
structure (as used by certificates). The functions i2d_EC_PUBKEY() and
d2i_EC_PUBKEY() will do the trick for EC keys. 

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to