Module

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

šŸ’§EventEmitter's typesafe replacement
Go to Latest
interface dom.SubtleCrypto
import { type dom } from "https://deno.land/x/evt@v2.3.1/lib/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(
key: CryptoKey,
data:
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| DataView
| ArrayBuffer
,
): PromiseLike<ArrayBuffer>
deriveBits(
baseKey: CryptoKey,
length: number,
): PromiseLike<ArrayBuffer>
deriveKey(
baseKey: CryptoKey,
extractable: boolean,
keyUsages: string[],
): PromiseLike<CryptoKey>
digest(algorithm: string | Algorithm, data:
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| DataView
| ArrayBuffer
): PromiseLike<ArrayBuffer>
encrypt(
key: CryptoKey,
data:
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| DataView
| 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(
extractable: boolean,
keyUsages: string[],
): PromiseLike<CryptoKeyPair>
generateKey(
extractable: boolean,
keyUsages: string[],
): PromiseLike<CryptoKey>
importKey(
format: "jwk",
keyData: JsonWebKey,
extractable: boolean,
keyUsages: string[],
): PromiseLike<CryptoKey>
importKey(
format: "raw" | "pkcs8" | "spki",
keyData:
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| DataView
| ArrayBuffer
,
extractable: boolean,
keyUsages: string[],
): PromiseLike<CryptoKey>
importKey(
format: string,
keyData:
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| DataView
| ArrayBuffer
,
extractable: boolean,
keyUsages: string[],
): PromiseLike<CryptoKey>
sign(
algorithm: ,
key: CryptoKey,
data:
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| DataView
| ArrayBuffer
,
): PromiseLike<ArrayBuffer>
unwrapKey(
format: string,
wrappedKey:
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| DataView
| ArrayBuffer
,
unwrappingKey: CryptoKey,
unwrapAlgorithm: string | Algorithm,
unwrappedKeyAlgorithm: string | Algorithm,
extractable: boolean,
keyUsages: string[],
): PromiseLike<CryptoKey>
verify(
algorithm: ,
key: CryptoKey,
signature:
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| DataView
| ArrayBuffer
,
data:
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| DataView
| ArrayBuffer
,
): PromiseLike<boolean>
wrapKey(
format: string,
key: CryptoKey,
wrappingKey: CryptoKey,
wrapAlgorithm: string | Algorithm,
): PromiseLike<ArrayBuffer>