{{APIRef}}{{SeeCompatTable}}
The CryptoKey
interface represents a cryptographic {{glossary("key")}} derived from a specific key algorithm.
A CryptoKey
object can be obtained using {{domxref("SubtleCrypto.generateKey()")}}, {{domxref("SubtleCrypto.deriveKey()")}} or {{domxref("SubtleCrypto.importKey()")}}
Properties
This interface doesn't inherit any property.
- {{domxref("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)
- {{domxref("CryptoKey.extractable")}}
- Returns a {{jsxref("Boolean")}} indicating if the raw information may be exported to the application or not.
- {{domxref("CryptoKey.algorithm")}}
- Returns an opaque object representing a particular cipher the key has to be used with.
- {{domxref("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 |
---|---|---|
{{ SpecName('Web Crypto API', '#dfn-CryptoKey', 'CryptoKey') }} | {{ Spec2('Web Crypto API') }} | Initial definition. |
Browser compatibility
{{ CompatibilityTable() }}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | {{ CompatChrome(37) }} | {{ CompatGeckoDesktop(34) }} | {{ CompatNo() }} | {{ CompatUnknown() }} | {{ CompatNo }} |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | 37 | {{ CompatChrome(37) }} | {{ CompatGeckoMobile(34) }} | {{ CompatNo }} | {{ CompatUnknown() }} | {{ CompatNo }} |
See also
- {{domxref("Crypto")}} and {{domxref("Crypto.subtle")}}.