Jan
unread,Mar 6, 2012, 10:30:12 AM3/6/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi,
I'm simply trying to read a private key from a 3DES encrypted pem key file but the PEM_read_bio_PrivateKey returns null.
> const char *file = "/tmp/priv.key";
> const char *pass = "123456";
>
> BIO *key BIO_new(BIO_s_file());
> if(key == NULL) {
> ...
> }
>
> if (BIO_read_filename(key,file) <= 0)
> ...
> }
>
> pkey = PEM_read_bio_PrivateKey(key, NULL, 0, pass);
> if (pkey == NULL)
> {
> BIO_printf(err, "unable to load signing key\n");
> }
>
The file does exists and the pin is correct but the pkey is all the time null. What am I doing wrong ?
I'm using OpenSSL 1.0 API
regards,
Jan