GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • MDN
  • HTML: Markup language
  • Elements
  • Global attributes
  • Attributes
  • See all…
  • Responsive images
  • HTML cheatsheet
  • Date & time formats
  • See all…
  • SVG
  • MathML
  • XML
  • CSS: Styling language

This view

  • Original page
  • New address

GeezerVison is showing developer.mozilla.org — CryptoKey - Web APIs | MDN

CryptoKey

Baseline
Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2016.

  • See full compatibility
  • Learn more

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Note: This feature is available in Web Workers.

The CryptoKey interface of the Web Crypto API represents a cryptographic key obtained from one of the SubtleCrypto methods generateKey(), deriveKey(), importKey(), or unwrapKey().

For security reasons, the CryptoKey interface can only be used in a secure context.

Instance properties

CryptoKey.type Read only

The type of key the object represents. It may take one of the following values: "secret", "private" or "public".

CryptoKey.extractable Read only

A boolean value indicating whether or not the key may be extracted using SubtleCrypto.exportKey() or SubtleCrypto.wrapKey().

CryptoKey.algorithm Read only

An object describing the algorithm for which this key can be used and any associated extra parameters.

CryptoKey.usages Read only

An Array of strings, indicating what can be done with the key. Possible values for array elements are "encrypt", "decrypt", "sign", "verify", "deriveKey", "deriveBits", "wrapKey", and "unwrapKey".

Examples

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

Specification
Web Cryptography Level 2
# cryptokey-interface

Browser compatibility

See also

  • Web Crypto API
  • Web security
  • Privacy, permissions, and information security
  • Crypto and Crypto.subtle.

Help improve MDN

Learn how to contribute

This page was last modified on Nov 30, 2025 by MDN contributors.

View this page on GitHub • Report a problem with this content
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.