Hello,
> 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?
Yes, PEM_read_RSAPublicKey require PKCS#1 but if public key was
generated with command like:
        $ openssl genrsa -out rsa.pem 1024 (PKCS#1 format)
        $ openssl rsa -in rsa.pem -out rsapub.pem -pubout
this public key (rsapub.pem) is encoded in SubjectPublicKeyInfo format.
For reading this format you may use PEM_read_RSA_PUBKEY
witch should read this public key.

You may check difference with encoded format executimg commands like:
        $ openssl asn1parse -in rsa.pem
        $ openssl asn1parse -in rsapub.pem

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

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

Reply via email to