The CryptoKey interface represents a cryptographic key derived from a specific key algorithm.

A CryptoKey object can be obtained using SubtleCrypto.generateKey(), SubtleCrypto.deriveKey() or SubtleCrypto.importKey()

Properties

This interface doesn't inherit any property.

CryptoKey.type
Returns an enumerated value representing the type of the key, a secret key (for symmetric algorithm), a public or a private key (for an asymmetric algorithm)
CryptoKey.extractable
Returns a Boolean indicating if the raw information may be exported to the application or not.
CryptoKey.algorithm
Returns an opaque object representing a particular cipher the key has to be used with.
CryptoKey.usages
Returns an array of enumerated values indicating what the key can be used for.

Methods

This interface neither inherits, nor implements, any method.

Specifications

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

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 37Edge Full support YesFirefox Full support 34IE No support NoOpera ? Safari No support NoWebView Android Full support 37Chrome Android Full support 37Edge Mobile Full support YesFirefox Android Full support 34Opera Android ? Safari iOS No support NoSamsung Internet Android Full support Yes
typeChrome Full support 37Edge Full support 12Firefox Full support 34IE No support NoOpera ? Safari No support NoWebView Android Full support 37Chrome Android Full support 37Edge Mobile Full support YesFirefox Android Full support 34Opera Android ? Safari iOS No support NoSamsung Internet Android Full support Yes
extractableChrome Full support 37Edge Full support 12Firefox Full support 34IE No support NoOpera ? Safari No support NoWebView Android Full support 37Chrome Android Full support 37Edge Mobile Full support YesFirefox Android Full support 34Opera Android ? Safari iOS No support NoSamsung Internet Android Full support Yes
algorithmChrome Full support 37Edge Full support 12Firefox Full support 34IE No support NoOpera ? Safari No support NoWebView Android Full support 37Chrome Android Full support 37Edge Mobile Full support YesFirefox Android Full support 34Opera Android ? Safari iOS No support NoSamsung Internet Android Full support Yes
usagesChrome Full support 37Edge Full support 12Firefox Full support 34IE No support NoOpera ? Safari No support NoWebView Android Full support 37Chrome Android Full support 37Edge Mobile Full support YesFirefox Android Full support 34Opera Android ? Safari iOS No support NoSamsung Internet Android Full support Yes

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

See also

Document Tags and Contributors

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