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" <oem2.pem >/dev/null 2>&1; then
  echo Password OK
else
  echo wrong password
  exit
fi

Regards

Christian



On Wed, Aug 06, 2003 at 04:45:26PM +0200, T. Valent wrote:
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
^ NO! just read passwd!

if openssl verifypassword -in MyKeyFile.pem -password "$passwd"; then echo Password OK
else
echo wrong password
exit
fi

-- Charles B (Ben) Cranston mailto: [EMAIL PROTECTED] http://www.wam.umd.edu/~zben

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to