Im trying to verify some private keys but the php method openssl_pkey_get_private() always return false. And the openssl_error_string() is returning:
error:0906D06C:PEM routines:PEM_read_bio:no start line
$return = openssl_pkey_get_private($path.'_priKEY.pem');
if ($return === false) {
var_dump(openssl_error_string());
}
Tried this with private key extracted from .pfx file, other from .p12 file, and even an self generated key (with openssl). Already tried with "RSA PRIVATE KEY", "ENCRYPTED PRIVATE KEY" and "PRIVATE KEY". Nothing changes.
Private key content:
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0B
[......................]
Wxdadnf7MB7DicckIZTKVy1L
-----END PRIVATE KEY-----
$path
variable? – Reinier Torenbeek