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.
An object that asynchronously returns the result of the verification operation.
The verify method supports the following cryptographic algorithms:
For a code example, see sign.