LOG IN SIGN UP
Documentation

digest.rsa_verify

A boolean function that returns true if the RSA digest using public_key of payload 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 set. The base64_method parameter is optional. It can be standard, url, url_nopad, or default (default is equivalent to url_nopad).

Format

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;