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(
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKeyPair>
generateKey(
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>
generateKey(
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKeyPair | CryptoKey>
importKey(
format: "jwk",
keyData: JsonWebKey,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>
exportKey(
format: "jwk",
key: CryptoKey,
): Promise<JsonWebKey>
unwrapKey(
format: KeyFormat,
wrappedKey: BufferSource,
unwrappingKey: CryptoKey,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>