$str.evpSign Returns a signature for a message created using your certificate's private key |
Usage |
<string> $str.evpSign(<message:string>[,<certificate:string>[,<password:string>]]) |
Description |
This function returns a base64-encoded signature string created signing the
provided <message> using the private key of the specified <certificate>. If the <certificate> parameter is omitted, the private key specified in the kvirc options will be used. If any error occurs, this function will return an empty string. |
Examples |
# Emulate a call with no parameters %message="test message"; %pcert=$file.read($option(stringSSLPrivateKeyPath)); %sign=$str.evpSign(%message,%pcert,$option(stringSSLPrivateKeyPass)); |
# 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.evpverify $certificate $dcc.getsslcertinfo |