[openssl-users] i2d and d2i fucntions

Rajeswari K raji.kotamraju at gmail.com
Thu Feb 12 05:39:32 UTC 2015


Hello Openssl users,

I have a query on d2i_PUBKEY() and i2d_PUBKEY().

i have a EC public key in form of character buffer.
Have inputted this character buffer to d2i_PUBKEY() and got EVP_PKEY format
EC key.

Now i tried to input this EVP_PKEY to i2d_PUBKEY() to compare will i get
exactly same data which i gave as input to d2i_PUBKEY().

But i see that the outputs are completely different.

i2d_PUBKEY() is leaving lots of 0's at the o/p buffer.

0
0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
FD  1   10  DF  AB  12  34  CD  0   6F  0   0   0   0   1   83
F   8B  AF  D8  D  ................................................

My goal is, to get complete EC public key in form of asn1 der encoded from
EC_KEY structure.

I tried to use i2d_EC_PUBKEY() and i20_ECPublickey(). But both results
seems similar.
0
FD  1   10  DF  AB  12  34  CD  0   6F  0   0   0   0   1   83
F   8B  AF  D8  D   ......................................

Can you please help me with respective API's to call to get complete EC
public key buffer which will have asn1 oid's, formats etc. included in the
public key buffer.

Thanks,
Rajeswari.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20150212/47fe638f/attachment.html>


More information about the openssl-users mailing list