As the title says. I can verify passphrase easily with php's openssl_pkcs12_read
for p12 certs, but it seems like there isn't similar function for pems. Maybe it's impossible to do this with pems?
Try this if you don't mind the password being on the command-line and in the shell history:
openssl rsa -noout -in YOUR_PRIVATE_KEY_FILE.pem -passin "pass:YOUR_PASSWORD"
or with the password in a file:
openssl rsa -noout -in YOUR_PRIVATE_KEY_FILE.pem -passin "file:/PATH/PASSWORD_FILE.TXT"
Or build around something like this:
if openssl rsa -noout -in "$KEYFILE" -passin "pass:$PASSWORD" 2>/dev/null; then
echo OK
else
echo "Wrong password"
fi
Have you tried php's openssl_x509_read
? Here.
Or, if you're just using openssl ,openssl x509 -text
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With