On this page
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 {
deriveKey(
algorithm:
,
baseKey: CryptoKey,
derivedKeyType:
,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>;
generateKey(
algorithm: RsaHashedKeyGenParams | EcKeyGenParams,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKeyPair>;
generateKey(
algorithm: AesKeyGenParams | HmacKeyGenParams,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>;
generateKey(
algorithm: AlgorithmIdentifier,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKeyPair | CryptoKey>;
importKey(
format: "jwk",
keyData: JsonWebKey,
algorithm:
,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>;
importKey(
format: Exclude<KeyFormat, "jwk">,
keyData: BufferSource,
algorithm:
,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>;
sign(
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams,
key: CryptoKey,
data: BufferSource,
): Promise<ArrayBuffer>;
unwrapKey(
format: KeyFormat,
wrappedKey: BufferSource,
unwrappingKey: CryptoKey,
unwrapAlgorithm:
,
unwrappedKeyAlgorithm:
,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>;
verify(
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams,
key: CryptoKey,
signature: BufferSource,
data: BufferSource,
): Promise<boolean>;
}
var SubtleCrypto: {
prototype: SubtleCrypto;
new (): SubtleCrypto;
};
Methods
decrypt(
algorithm:
,
key: CryptoKey,
data: BufferSource,
): Promise<ArrayBuffer>
deriveBits(
algorithm:
,
baseKey: CryptoKey,
length: number,
): Promise<ArrayBuffer>
digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>
encrypt(
algorithm:
,
key: CryptoKey,
data: BufferSource,
): Promise<ArrayBuffer>
exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>
generateKey(
algorithm: RsaHashedKeyGenParams | EcKeyGenParams,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKeyPair>
generateKey(
algorithm: AesKeyGenParams | HmacKeyGenParams,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>
generateKey(
algorithm: AlgorithmIdentifier,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKeyPair | CryptoKey>
importKey(
format: "jwk",
keyData: JsonWebKey,
algorithm:
,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>
importKey(
format: Exclude<KeyFormat, "jwk">,
keyData: BufferSource,
algorithm:
,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>
sign(
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams,
key: CryptoKey,
data: BufferSource,
): Promise<ArrayBuffer>
unwrapKey(
format: KeyFormat,
wrappedKey: BufferSource,
unwrappingKey: CryptoKey,
unwrapAlgorithm:
,
unwrappedKeyAlgorithm:
,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>
verify(
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams,
key: CryptoKey,
signature: BufferSource,
data: BufferSource,
): Promise<boolean>
© 2018–2022 the Deno authors
https://doc.deno.land/deno/stable/~/SubtleCrypto