note 21889 added to function.openssl-verify
| From: | steve dot venable at lmco dot com | Date: | Thu, 30 May 2002 16:36:09 +0000 |
| Subject: | note 21889 added to function.openssl-verify | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-31223@lists.php.net to get a copy of this message | ||
A note about the openssl_verify() (and some of the other functions). The public key comes from a
certificate in any of the support formats (as the example shows, use openssl_get_publickey() to get
the resource id). But after some trial and error I found the signature string MUST BE BINARY.
While no error occurs, passing a base64-formatted signature string (PEM format?), you simply get a
mismatch. When I did the base64 decode myself, the verify returned a match (return value 1). You
can simply drop the begin/end lines and take the output of the 'base64_decode()' function.
--
http://www.php.net/manual/en/function.openssl-verify.php
http://master.php.net/manage/user-notes.php?action=edit+21889
http://master.php.net/manage/user-notes.php?action=delete+21889
http://master.php.net/manage/user-notes.php?action=reject+21889