Skip to main content

SubtleCrypto

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 globalThis.crypto).

Jump to headinggenerateKey(
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKeyPair>
Jump to headinggenerateKey(
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>
Jump to headinggenerateKey(
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKeyPair | CryptoKey>
Jump to headingimportKey(
format: "jwk",
keyData: JsonWebKey,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>
Jump to headingimportKey(
format: Exclude<KeyFormat, "jwk">,
keyData: BufferSource,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>
Jump to headingexportKey(
format: "jwk",
key: CryptoKey,
): Promise<JsonWebKey>
Jump to headingexportKey(
format: Exclude<KeyFormat, "jwk">,
key: CryptoKey,
): Promise<ArrayBuffer>
Jump to headingdigest(): Promise<ArrayBuffer>
Jump to headingderiveBits(
baseKey: CryptoKey,
length: number,
): Promise<ArrayBuffer>
Jump to headingwrapKey(): Promise<ArrayBuffer>
Jump to headingunwrapKey(
format: KeyFormat,
wrappedKey: BufferSource,
unwrappingKey: CryptoKey,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>
Back to top