The SubtleCrypto.verify() method returns a Promise of a Boolean value indicating if the signature given as parameter matches the text, algorithm and key also given as parameters.


var result = crypto.subtle.verify(algo, key, signature, text2verify);


  • signature is a ArrayBuffer or an ArrayBufferView containing the signature to verify.
  • text2verify is a ArrayBuffer or an ArrayBufferView containing the data whose signature as to be verified.
  • key is a CryptoKey containing the key to be used to verify the signature. It is the secret key for a symmetric algorithm and the public key for an asymmetric algorithm.
  • algo is a DOMString defining the signature function to use. Supported values are: HMAC, RSASSA-PKCS1-v1_5, and ECDSA.

Return value

  • result is a Promise that returns a Boolean indicating if the signature has been a success on success.


The promise is rejected when the following exception is encountered:

  • InvalidAccessError when the encryption key is not a key for the requested verifying algorithm or when trying to use an algorithm that is either unknown or isn't suitable for a verify operation.


Specification Status Comment
Web Cryptography API
The definition of 'SubtleCrypto.verify()' in that specification.
Recommendation Initial definition.

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic support 37 (Yes) 34 (34) No support ? No support
Feature Android Chrome for Android Edge Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support (Yes) 37 (Yes) 34.0 (34) No support ? No support

See also

Document Tags and Contributors

 Contributors to this page: Dans24, abbycar, jyasskin, teoli, GreatCall-KayeK
 Last updated by: Dans24,