I want to read public part of RSA. The input file is PEM format file generated 
by openssl genrsa for private and openssl rsa for public. Do you mean this is 
not the correct format for PEM_read_RSAPublicKey?

Sonia

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Marek Marcola
Sent: Monday, July 03, 2006 8:25 AM
To: [email protected]
Subject: RE: Private Key Type and PEM Length


Hello,
> I tried the PEM_read_RSAPrivateKey and PEM_read_RSAPublicKey pair. 
> PEM_read_RSAPrivateKey seems work fine. 
> PEM_read_RSAPublicKey failed. 
> By tracing, it failed in BIO_gets(), returning 0. Any idea?
PEM_read_RSAPublicKey reads from PKCS#1 ASN1 structure public
part of RSA key (n,e).
Input data to PEM_read_RSAPrivateKey() and PEM_read_RSAPublicKey()
should have the same form (and not X509 certificate).
I do not now if you want to read "public part of RSA key" or
certificate (with public key too :-).
If you want read certificate - PEM_read_X509 is proper solution.

Best regards,
-- 
Marek Marcola <[EMAIL PROTECTED]>

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [email protected]
Automated List Manager                           [EMAIL PROTECTED]
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [email protected]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to