On Sun, Jan 05, 2014, Alan D. Cabrera wrote:

> I've created a public key file using the following commands:
> 
> openssl genrsa -out mykey.pem 2046
> openssl rsa -in mykey.pem -pubout > mykey.pub
> 
> I then read it from some C code:
> 
> public_key = PEM_read_RSA_PUBKEY(fp, NULL, NULL, NULL);
> 
> and then obtain the DER form of this public key:
> 
> int len = i2d_RSAPublicKey (public_key, NULL);
> buf = (unsigned char *) malloc (len);
> i2d_RSAPublicKey (public_key, &buf);
> here len == 269
> 

http://www.openssl.org/support/faq.html#PROG3

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