Read RSA PrivateKey from PEM in buffer

2012-07-29 Thread Jonas Schnelli
Hi I can read in a RSA private key from file without problems (with PEM_read_RSAPrivateKey). But now i would like to read in a PEM RSA Key from a void *buffer with size_t length. How can i do this? PEM_read_RSAPrivateKey only reads from FILE. I'm sure theres a ways to work around writing a tmp

Re: Read RSA PrivateKey from PEM in buffer

2012-07-29 Thread Jason Goldberg
Copy the PEM key from your buffer into a BIO instance (using BIO_write for example), and then use PEM_read_bio_RSAPrivateKey. Jason On Jul 29, 2012, at 5:52 AM, Jonas Schnelli jonas.schne...@include7.ch wrote: Hi I can read in a RSA private key from file without problems (with