files/en-us/web/api/cryptokey/index.md
{{APIRef("Web Crypto API")}}{{SecureContext_header}}{{AvailableInWorkers}}
The CryptoKey interface of the Web Crypto API represents a cryptographic {{glossary("key")}} obtained from one of the {{domxref("SubtleCrypto")}} methods {{domxref("SubtleCrypto.generateKey", "generateKey()")}}, {{domxref("SubtleCrypto.deriveKey", "deriveKey()")}}, {{domxref("SubtleCrypto.importKey", "importKey()")}}, or {{domxref("SubtleCrypto.unwrapKey", "unwrapKey()")}}.
For security reasons, the CryptoKey interface can only be used in a secure context.
{{domxref("CryptoKey.type")}} {{ReadOnlyInline}}
"secret", "private" or "public".{{domxref("CryptoKey.extractable")}} {{ReadOnlyInline}}
SubtleCrypto.exportKey() or SubtleCrypto.wrapKey().{{domxref("CryptoKey.algorithm")}} {{ReadOnlyInline}}
{{domxref("CryptoKey.usages")}} {{ReadOnlyInline}}
"encrypt", "decrypt", "sign", "verify", "deriveKey", "deriveBits", "wrapKey", and "unwrapKey".The examples for SubtleCrypto methods often use CryptoKey objects. For example:
SubtleCrypto.generateKey()SubtleCrypto.deriveKey()SubtleCrypto.importKey()SubtleCrypto.exportKey()SubtleCrypto.wrapKey()SubtleCrypto.unwrapKey()SubtleCrypto.encrypt()SubtleCrypto.decrypt()SubtleCrypto.sign()SubtleCrypto.verify(){{Specifications}}
{{Compat}}