SubtleCrypto
Этот интерфейс Web Crypto API предоставляет ряд криптографических функций низкого уровня. К нему можно получить доступ через свойства Crypto.subtle, доступные в контексте окна (через 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;};
Методы
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