Is there a command line option for openssl to just verify a password for
a key?
I thought I could use a line in a script like:
echo Please enter password for key
read $passwd
if openssl verifypassword -in MyKeyFile.pem -password "$passwd"; then
echo Password OK
else
echo wrong password
exit
f
Gee, I was typing in the exact same solution!
NOTE THERE SHOULD NOT BE A DOLLAR SIGN ON THE SHELL READ STATEMENT!
(this had me going for awhile!)
Christian Hohnstaedt wrote:
if openssl rsa -passin pass:"$passwd" /dev/null 2>&1; then
echo Password OK
else
echo wrong password
exit
fi
Regards