LOG IN SIGN UP
Documentation

digest.rsa_verify()

A boolean function that returns true if the RSA signature of payload using public_key matches digest. The hash_method parameter selects the digest function to use. It can be sha256, sha384, sha512, or default (default is equivalent to sha256). The STRING_LIST parameter in the payload/digest could reference headers such as req.http.payload and req.http.digest. The base64_method parameter is optional. It can be standard, url, url_nopad, or default (default is equivalent to url_nopad).

Format

BOOL
digest.rsa_verify(ID hash_method, STRING_LIST public_key, STRING_LIST payload, STRING_LIST digest [, ID base64_method ])

Examples

if (digest.rsa_verify(sha256, {"-----BEGIN PUBLIC KEY-----
aabbccddIieEffggHHhEXAMPLEPUBLICKEY
-----END PUBLIC KEY-----"}, req.http.payload, req.http.digest, url_nopad)) {
  set req.http.verified = "Verified";
} else {
  set req.http.verified = "Not Verified";
}
error 900;