← Back to index
interface SubtleCrypto

This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto).

Methods

🔗
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>
🔗
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>
🔗
generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>
🔗
importKey(
format: "jwk"
keyData: JsonWebKey
extractable: boolean
keyUsages: KeyUsage[]
): Promise<CryptoKey>
🔗
importKey(
format: Exclude<KeyFormat, "jwk">
keyData: BufferSource
extractable: boolean
keyUsages: KeyUsage[]
): Promise<CryptoKey>
🔗
exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>
🔗
exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>
🔗
sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>
🔗
verify(): Promise<boolean>
🔗
digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>
🔗
encrypt(algorithm: , key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>
🔗
decrypt(algorithm: , key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>
🔗
deriveBits(algorithm: , baseKey: CryptoKey, length: number): Promise<ArrayBuffer>
🔗
deriveKey(): Promise<CryptoKey>
🔗
wrapKey(): Promise<ArrayBuffer>
🔗
unwrapKey(
format: KeyFormat
wrappedKey: BufferSource
unwrappingKey: CryptoKey
extractable: boolean
keyUsages: KeyUsage[]
): Promise<CryptoKey>