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
Booleanindicating 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
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
| Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|---|
| Basic support | 37 | Yes | 34 | No | ? | No |
type | 37 | Yes | 34 | No | ? | No |
extractable | 37 | Yes | 34 | No | ? | No |
algorithm | 37 | Yes | 34 | No | ? | No |
usages | 37 | Yes | 34 | No | ? | No |
| Feature | Android webview | Chrome for Android | Edge mobile | Firefox for Android | Opera Android | iOS Safari | Samsung Internet |
|---|---|---|---|---|---|---|---|
| Basic support | 37 | 37 | Yes | 34 | ? | No | ? |
type | 37 | 37 | Yes | 34 | ? | No | ? |
extractable | 37 | 37 | Yes | 34 | ? | No | ? |
algorithm | 37 | 37 | Yes | 34 | ? | No | ? |
usages | 37 | 37 | Yes | 34 | ? | No | ? |
See also
CryptoandCrypto.subtle.

