Returns an object that can verify that the given signature or message authentication code (MAC) is valid for the given data using the specified algorithm and key object. If the signature or MAC is invalid, then either the data or the signature/MAC has been tampered with since the signature/MAC was generated.
Syntaxvar retVal = SubtleCrypto.verify(algorithm, key, signature, buffer);
- algorithm [in]
An object identifying the cryptographic algorithm that was used to generate the signature or MAC (along with any required algorithmic parameters).
- key [in]
The key to be used for verifying the signature or MAC. For signatures, this is the public key corresponding to the private key that was used to create the signature. For MACs, this is the key that was used to create the MAC.
- signature [in]
The signature or MAC.
- buffer [in, optional]
The data over which the signature or MAC was purportedly computed.
A Promise object that will verify data using the specified algorithm with the supplied key.
The verify method supports the following cryptographic algorithms:
For a code example, see sign.