Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/evt/lib/types/index.ts>dom.SubtleCrypto

💧EventEmitter's typesafe replacement
Go to Latest
interface dom.SubtleCrypto
import { type dom } from "https://deno.land/x/evt@v2.4.16/lib/types/index.ts";
const { SubtleCrypto } = dom;

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

decrypt(
algorithm:
| string
| AesCmacParams
| AesCfbParams
,
key: CryptoKey,
data:
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| ArrayBuffer
,
): PromiseLike<ArrayBuffer>
deriveBits(
algorithm:
| string
| DhKeyDeriveParams
| ConcatParams
| HkdfCtrParams
,
baseKey: CryptoKey,
length: number,
): PromiseLike<ArrayBuffer>
deriveKey(
algorithm:
| string
| DhKeyDeriveParams
| ConcatParams
| HkdfCtrParams
,
baseKey: CryptoKey,
derivedKeyType:
| string
| ConcatParams
| HkdfCtrParams
,
extractable: boolean,
keyUsages: string[],
): PromiseLike<CryptoKey>
digest(algorithm: string | Algorithm, data:
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| ArrayBuffer
): PromiseLike<ArrayBuffer>
encrypt(
algorithm:
| string
| AesCmacParams
| AesCfbParams
,
key: CryptoKey,
data:
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| ArrayBuffer
,
): PromiseLike<ArrayBuffer>
exportKey(format: "jwk", key: CryptoKey): PromiseLike<JsonWebKey>
exportKey(format: "raw" | "pkcs8" | "spki", key: CryptoKey): PromiseLike<ArrayBuffer>
exportKey(format: string, key: CryptoKey): PromiseLike<JsonWebKey | ArrayBuffer>
generateKey(
algorithm: string,
extractable: boolean,
keyUsages: string[],
): PromiseLike<CryptoKeyPair | CryptoKey>
generateKey(
algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams,
extractable: boolean,
keyUsages: string[],
): PromiseLike<CryptoKeyPair>
generateKey(
extractable: boolean,
keyUsages: string[],
): PromiseLike<CryptoKey>
importKey(
format: "jwk",
keyData: JsonWebKey,
algorithm: ,
extractable: boolean,
keyUsages: string[],
): PromiseLike<CryptoKey>
importKey(
format: "raw" | "pkcs8" | "spki",
keyData:
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| ArrayBuffer
,
algorithm: ,
extractable: boolean,
keyUsages: string[],
): PromiseLike<CryptoKey>
importKey(
format: string,
keyData:
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| ArrayBuffer
,
algorithm: ,
extractable: boolean,
keyUsages: string[],
): PromiseLike<CryptoKey>
sign(
algorithm:
| string
| AesCmacParams
,
key: CryptoKey,
data:
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| ArrayBuffer
,
): PromiseLike<ArrayBuffer>
unwrapKey(
format: string,
wrappedKey:
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| ArrayBuffer
,
unwrappingKey: CryptoKey,
unwrapAlgorithm: string | Algorithm,
unwrappedKeyAlgorithm: string | Algorithm,
extractable: boolean,
keyUsages: string[],
): PromiseLike<CryptoKey>
verify(
algorithm:
| string
| AesCmacParams
,
key: CryptoKey,
signature:
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| ArrayBuffer
,
data:
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| ArrayBuffer
,
): PromiseLike<boolean>
wrapKey(
format: string,
key: CryptoKey,
wrappingKey: CryptoKey,
wrapAlgorithm: string | Algorithm,
): PromiseLike<ArrayBuffer>