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 compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support371234 No ? No
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support3737 Yes34 ? No Yes

See also

Document Tags and Contributors

Contributors to this page: fscholz, erikadoyle, teoli
Last updated by: fscholz,