as

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

SubtleCrypto

SubtleCrypto

构造函数

new SubtleCrypto()

new SubtleCrypto(internalWebCrypto): SubtleCrypto

参数

internalWebCrypto

InternalWebCrypto

返回值

SubtleCrypto

方法

decrypt()

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

参数

algorithm

EncryptionAlgorithm

key

CryptoKey

data

BufferSource

返回值

Promise<ArrayBuffer>


deriveBits()

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

参数

algorithm

DerivationAlgorithm

baseKey

CryptoKey

length

number

返回值

Promise<ArrayBuffer>


deriveKey()

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

参数

algorithm

DerivationAlgorithm

baseKey

CryptoKey

derivedKeyAlgorithm

DerivedKeyAlgorithm

extractable

boolean

keyUsages

KeyUsage[]

返回值

Promise<CryptoKey>


digest()

digest(algorithm, data): Promise<ArrayBuffer>

参数

algorithm

DigestAlgorithm

data

BufferSource

返回值

Promise<ArrayBuffer>


encrypt()

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

参数

algorithm

EncryptionAlgorithm

key

CryptoKey

data

BufferSource

返回值

Promise<ArrayBuffer>


exportKey()

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

参数

format

KeyFormat

key

CryptoKey

返回值

Promise<ArrayBuffer | JsonWebKey>


generateKey()

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

参数

algorithm

KeyGenAlgorithm

extractable

boolean

用法

KeyUsage[]

返回值

Promise<CryptoKey | CryptoKeyPair>


importKey()

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

参数

format

KeyFormat

keyData
JsonWebKey BufferSource
algorithm

KeyImportAlgorithm

extractable

boolean

keyUsages

KeyUsage[]

返回值

Promise<CryptoKey>


sign()

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

参数

algorithm

SignatureAlgorithm

key

CryptoKey

data

BufferSource

返回值

Promise<ArrayBuffer>


verify()

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

参数

algorithm

SignatureAlgorithm

key

CryptoKey

signature

ArrayBuffer

data

ArrayBuffer

返回值

Promise<boolean>


Last updated: 2025年10月2日