SubtleCrypto.exportKey()

この記事はまだボランティアによって 日本語 に翻訳されていません。ぜひ MDN に参加して翻訳を手伝ってください!
この記事を English (US) で読むこともできます。

The SubtleCrypto.exportKey() method returns a Promise of the key encrypted in the requested format. If the key is not extractable, that is if CryptoKey.extractable returns false, the promise fails with an InvalidAccessError exception; it the format is unknown, the promive fails with a NotSupported exception.

Syntax

var result = crypto.subtle.exportKey(format, key);

Parameters

  • format is an enumerated value describing the data format in which the key has to be exported. It can be one of the following:
  • key is the CryptoKey to export.

Return value

  • result is a Promise that returns the key in the requested format.

Exceptions

The promise is rejected when one of the following exceptions is encountered:

Specifications

Specification Status Comment
Web Cryptography API
The definition of 'SubtleCrypto.exportKey()' in that specification.
Recommendation Initial definition.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support3712

34

32 — 341

112247
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support373712

34

32 — 341

2476.0

1. From version 32 until version 34 (exclusive): this feature is behind the dom.webcrypto.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.

2. Returns KeyOperation instead of Promise

See also

ドキュメントのタグと貢献者

このページの貢献者: fscholz, fozi, Dans24, abbycar, teoli
最終更新者: fscholz,