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

interface SubtleCrypto {
decrypt(
key: CryptoKey,
): Promise<ArrayBuffer>;
deriveBits(
baseKey: CryptoKey,
length: number,
): Promise<ArrayBuffer>;
deriveKey(
baseKey: CryptoKey,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>;
digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>;
encrypt(
key: CryptoKey,
): Promise<ArrayBuffer>;
exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
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>;
importKey(
format: Exclude<KeyFormat, "jwk">,
keyData: BufferSource,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>;
sign(
key: CryptoKey,
): Promise<ArrayBuffer>;
unwrapKey(
format: KeyFormat,
wrappedKey: BufferSource,
unwrappingKey: CryptoKey,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>;
verify(
key: CryptoKey,
signature: BufferSource,
): Promise<boolean>;
wrapKey(
format: KeyFormat,
key: CryptoKey,
wrappingKey: CryptoKey,
): Promise<ArrayBuffer>;
}
var SubtleCrypto: {
prototype: SubtleCrypto;
new (): SubtleCrypto;
}
;

§Methods

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