as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持

CryptoKey

CryptoKey

Web Crypto API的CryptoKey接口表示通过generateKey()importKey() 这两种SubtleCrypto方法中的一种获得的密码密钥。

访问器

algorithm

获取签名

get algorithm(): RsaHashedKeyGenParams | EcKeyGenParams | HmacKeyGenParams | AesKeyGenParams

一个对象,用于描述可以使用此密钥的算法以及任何相关的额外参数。返回的对象取决于用于生成密钥的算法。

返回值

RsaHashedKeyGenParams | EcKeyGenParams | HmacKeyGenParams | AesKeyGenParams

匹配的对象:


extractable

获取签名

get extractable(): boolean

一个布尔值,表示是否可以使用SubtleCrypto.exportKey() 提取密钥。

返回值

boolean


type

获取签名

get type(): string

对象表示的密钥类型。密钥类型可能采用以下值之一:“secret”、“private”或“public”。

返回值

string


usages

获取签名

get usages(): string[]

一个字符串数组,表示可以用密钥执行的操作。数组元素的可能值是“encrypt”、“decrypt”、“sign”、“verify”、“deriveKey”、“deriveBits”、“wrapKey”和“unwrapKey”。

返回值

string[]


Last updated: 2025年10月2日