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

x/simplewebauthn/packages/types/src/dom.ts>SubtleCrypto

WebAuthn, Simplified. A collection of TypeScript-first libraries for simpler WebAuthn integration. Supports modern browsers, Node, Deno, and more.
Latest
interface SubtleCrypto
import { type SubtleCrypto } from "https://deno.land/x/simplewebauthn@v11.0.0/packages/types/src/dom.ts";

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). Available only in secure contexts.

MDN Reference

Methods

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