Dan Ribe wrote:
Hi, I am trying to read the private key from the memory buffer (code snippet below), But PEM_read_bio_PrivateKey() always returns an error : OpenSSL error: error:0906D06C:PEM routines:PEM_read_bio:no start line Can anyone please point out what I am doing wrong here. I am pretty new to OpenSSL, so please excuse me if i have messed up the things ! Code Snippet : char *key = "-----BEGIN RSA PRIVATE KEY-----" "jGK1T++C+Np4As+KoaO2NCiCBN5UQJRzXBsZvLDoN6IcfxJwXklp560jrKiIZ8VU" "N2AZVq28yjqt3RYaRPn0xhbmLfWH/o+wzlg58wIDAQABAoIBAAHEep7qWWMFWsbc"
I think you need the "\n" at the end of each line (or possibly \r\n): char *key = "-----BEGIN RSA PRIVATE KEY-----\n" ^ "jGK1T++C+Np4As+KoaO2NCiCBN5UQJRzXBsZvLDoN6IcfxJwXklp560jrKiIZ8VU\n" ^ "N2AZVq28yjqt3RYaRPn0xhbmLfWH/o+wzlg58wIDAQABAoIBAAHEep7qWWMFWsbc\n" ^ etc. Tom ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]