W3cubDocs

/DOM

CryptoKey.usages

The CryptoKey.usages read-only property is an array of enumerated that indicates the purposes of the key.

Possible values are:

  • "encrypt", allowing the key to be used for encrypting messages.
  • "decrypt", allowing the key to be used for decrypting messages.
  • "sign", allowing the key to be used for signing messages.
  • "verify", allowing the key to be used for verifying the signature of messages.
  • "deriveKey", allowing the key to be used as a base key when deriving a new key.
  • "deriveBits", allowing the key to be used as a base key when deriving bits of data for use in cryptographic primitives.
  • "wrapKey", allowing the key to wrap a symmetric key for usage (transfer, storage) in unsecure environments.
  • "unwrapKey", allowing the key to unwrap a symmetric key for usage (transfer, storage) in unsecure environments.

Syntax

result = key.usages

Return value

  • result is an Array of enumerated values.

Specifications

Specification Status Comment
Web Cryptography API
The definition of 'CryptoKey.usages' in that specification.
Recommendation Initial definition.

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support 37 12 34 No ? No
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support 37 37 Yes 34 ? No Yes

See also

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/CryptoKey/usages