as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
感谢您的访问。此页面目前仅提供英语版本。我们正在开发中文版本。谢谢您的理解。

SubtleCrypto

Constructors

new SubtleCrypto()

new SubtleCrypto(internalWebCrypto): SubtleCrypto

Parameters

internalWebCrypto

InternalWebCrypto

Returns

SubtleCrypto

Methods

decrypt()

decrypt(algorithm, key, data): Promise<ArrayBuffer>

Parameters

algorithm

EncryptionAlgorithm

key

CryptoKey

data

BufferSource

Returns

Promise<ArrayBuffer>


deriveBits()

deriveBits(algorithm, baseKey, length): Promise<ArrayBuffer>

Parameters

algorithm

DerivationAlgorithm

baseKey

CryptoKey

length

number

Returns

Promise<ArrayBuffer>


deriveKey()

deriveKey(algorithm, baseKey, derivedKeyAlgorithm, extractable, keyUsages): Promise<CryptoKey>

Parameters

algorithm

DerivationAlgorithm

baseKey

CryptoKey

derivedKeyAlgorithm

DerivedKeyAlgorithm

extractable

boolean

keyUsages

KeyUsage[]

Returns

Promise<CryptoKey>


digest()

digest(algorithm, data): Promise<ArrayBuffer>

Parameters

algorithm

DigestAlgorithm

data

BufferSource

Returns

Promise<ArrayBuffer>


encrypt()

encrypt(algorithm, key, data): Promise<ArrayBuffer>

Parameters

algorithm

EncryptionAlgorithm

key

CryptoKey

data

BufferSource

Returns

Promise<ArrayBuffer>


exportKey()

exportKey(format, key): Promise<ArrayBuffer | JsonWebKey>

Parameters

format

KeyFormat

key

CryptoKey

Returns

Promise<ArrayBuffer | JsonWebKey>


generateKey()

generateKey(algorithm, extractable, usages): Promise<CryptoKey | CryptoKeyPair>

Parameters

algorithm

KeyGenAlgorithm

extractable

boolean

usages

KeyUsage[]

Returns

Promise<CryptoKey | CryptoKeyPair>


importKey()

importKey(format, keyData, algorithm, extractable, keyUsages): Promise<CryptoKey>

Parameters

format

KeyFormat

keyData
JsonWebKey BufferSource
algorithm

KeyImportAlgorithm

extractable

boolean

keyUsages

KeyUsage[]

Returns

Promise<CryptoKey>


sign()

sign(algorithm, key, data): Promise<ArrayBuffer>

Parameters

algorithm

SignatureAlgorithm

key

CryptoKey

data

BufferSource

Returns

Promise<ArrayBuffer>


verify()

verify(algorithm, key, signature, data): Promise<boolean>

Parameters

algorithm

SignatureAlgorithm

key

CryptoKey

signature

ArrayBuffer

data

ArrayBuffer

Returns

Promise<boolean>


Last updated: Oct 02, 2025