Re: Loading a public RSA key from a DER file

2009-05-08 Thread Mounir IDRASSI
Hi, The PKCS#1 encoding is dedicated to RSA keys and consists of an ASN.1 collection of the RSA key components (a description can be found on the PKCS#1 spec from RSA, section A.1.1 and A.1.2, ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/pkcs-1v2-1.pdf). SubjectPublicKeyInfo is more generic:

Re: Loading a public RSA key from a DER file

2009-05-06 Thread Sébastien Hinderer
Hi Mounir, > Your file pk.der contains a public key encoded as a SubjectPublicKeyInfo > and NOT as a PKCS#1 encoding. So, you should use the function > d2i_RSA_PUBKEY instead of d2i_RSAPublicKey in order to read the public > key. Ah I thought I tried this one but apparently I did not. It works in

Re: Loading a public RSA key from a DER file

2009-05-06 Thread Mounir IDRASSI
Hi, Your file pk.der contains a public key encoded as a SubjectPublicKeyInfo and NOT as a PKCS#1 encoding. So, you should use the function d2i_RSA_PUBKEY instead of d2i_RSAPublicKey in order to read the public key. Cheers, -- Mounir IDRASSI IDRIX http://www.idrix.fr > Dear all, > > I am working