Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. CryptoKey

CryptoKey

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2015⁩.

Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.

Note: This feature is available inWeb Workers.

TheCryptoKey interface of theWeb Crypto API represents a cryptographickey obtained from one of theSubtleCrypto methodsgenerateKey(),deriveKey(),importKey(), orunwrapKey().

For security reasons, theCryptoKey interface can only be used in asecure context.

Instance properties

CryptoKey.typeRead only

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

CryptoKey.extractableRead only

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

CryptoKey.algorithmRead only

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

CryptoKey.usagesRead only

AnArray 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 forSubtleCrypto methods often useCryptoKey objects. For example:

Specifications

Specification
Web Cryptography Level 2
# cryptokey-interface

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp