CryptoKey.type

我们的志愿者还没有将这篇文章翻译为 中文 (简体)加入我们帮助完成翻译!
您也可以阅读此文章的English (US)版。

The CryptoKey.type read-only property that indicates the type of the key: if it is the key for a symmetric algorithm ("secret") or for an asymmetric algorithm ("public" or "private", depending of its purpose).

Syntax

result = key.type

Return value

  • result is an enumerated value that can be:
    • "secret" represents the unique key used for encrypting or decrypting a message using a symmetric algorithm.
    • "public" represents a publicly shareable key used in an asymmetric algorithm.
    • "private" represents a key used in an asymmetric algorithm that must be kept private.

Specifications

Specification Status Comment
Web Cryptography API
The definition of 'CryptoKey.type' in that specification.
Candidate Recommendation Initial definition.

Browser compatibility

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic support 37 (Yes) 34 (34) No support ? No support
Feature Android Chrome for Android Edge Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support (Yes) 37 (Yes) 34.0 (34) No support ? No support

See also

文档标签和贡献者