![]() |
![]() |
$str.evpVerify Verifies the signature for a message against a public key |
Usage |
<bool> $str.evpVerify(<message:string>,<signature:string>[,<certificate:string>[,<password:string>]]) |
Description |
This function verifies the signature for a message against a public key contained in a certificate. The signature has to be base64-encoded, as the one returned by $str.evpsign. If the <certificate> parameter is omitted, the public key certificate specified in the kvirc options will be used. If any error occurs, this function will return false. |
Examples |
# Emulate a call with no certificate parameters
%message="test message";
%signature=$str.evpSign(%message);
%cert=$file.read($option(stringSSLCertificatePath));
$str.evpVerify(%message,%signature,%cert,$option(stringSSLCertificatePass));
# Sign and verify the signature using the certificates from options
%message="test message";
%sign=$str.evpSign(%message);
if($str.evpVerify(%message, %sign))
{
echo "signature is valid";
} else {
echo "signature is not valid";
}
|
See also |
$str.evpsign $certificate $dcc.getsslcertinfo |