Re: Read DER-encoded RSA public key in memory?

2009-07-20 Thread Mounir IDRASSI
Hi, The public key in your source is encoded as a SubjectPublicKeyInfo, so you can't use d2i_PublicKey which only handles RSA public keys encoded in the PKCS#1 format. In your case, you have to use the function d2i_PUBKEY_bio to read your hard-coded key. Here is how you can do it using the

Re: Read DER-encoded RSA public key in memory?

2009-07-20 Thread Jeremy R.
Thanks. I switched to using d2i_PUBKEY (it really is hard-coded, so I don't think there's a reason to use BIO – if I'm mistaken, please tell me) and it now returns a valid address in memory. On 20-Jul-09, at 4:59 PM, Mounir IDRASSI wrote: Hi, The public key in your source is encoded as a

Re: Read DER-encoded RSA public key in memory?

2009-07-20 Thread Mounir IDRASSI
Yes, d2i_PUBKEY is sufficient. -- Mounir IDRASSI IDRIX http://www.idrix.fr Jeremy R. wrote: Thanks. I switched to using d2i_PUBKEY (it really is hard-coded, so I don't think there's a reason to use BIO – if I'm mistaken, please tell me) and it now returns a valid address in memory. On