Spec-Zone.ru › Deno 1

SubtleCrypto

Этот интерфейс Web Crypto API предоставляет ряд криптографических функций низкого уровня. К нему можно получить доступ через свойства Crypto.subtle, доступные в контексте окна (через Window.crypto).

interface SubtleCrypto {
decrypt(
algorithm:
| AlgorithmIdentifier
| RsaOaepParams
| AesCbcParams
| AesGcmParams
| AesCtrParams
,
key: CryptoKey,
data: BufferSource,
): Promise<ArrayBuffer>;
deriveBits(
algorithm:
| AlgorithmIdentifier
| HkdfParams
| Pbkdf2Params
| EcdhKeyDeriveParams
,
baseKey: CryptoKey,
length: number,
): Promise<ArrayBuffer>;
deriveKey(
algorithm:
| AlgorithmIdentifier
| HkdfParams
| Pbkdf2Params
| EcdhKeyDeriveParams
,
baseKey: CryptoKey,
derivedKeyType:
| AlgorithmIdentifier
| AesDerivedKeyParams
| HmacImportParams
| HkdfParams
| Pbkdf2Params
,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>;
digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>;
encrypt(
algorithm:
| AlgorithmIdentifier
| RsaOaepParams
| AesCbcParams
| AesGcmParams
| AesCtrParams
,
key: CryptoKey,
data: BufferSource,
): Promise<ArrayBuffer>;
exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
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:
| AlgorithmIdentifier
| HmacImportParams
| RsaHashedImportParams
| EcKeyImportParams
,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>;
importKey(
format: Exclude<KeyFormat, "jwk">,
keyData: BufferSource,
algorithm:
| AlgorithmIdentifier
| HmacImportParams
| RsaHashedImportParams
| EcKeyImportParams
,
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:
| AlgorithmIdentifier
| RsaOaepParams
| AesCbcParams
| AesCtrParams
,
unwrappedKeyAlgorithm:
| AlgorithmIdentifier
| HmacImportParams
| RsaHashedImportParams
| EcKeyImportParams
,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>;
verify(
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams,
key: CryptoKey,
signature: BufferSource,
data: BufferSource,
): Promise<boolean>;
wrapKey(
format: KeyFormat,
key: CryptoKey,
wrappingKey: CryptoKey,
wrapAlgorithm:
| AlgorithmIdentifier
| RsaOaepParams
| AesCbcParams
| AesCtrParams
,
): Promise<ArrayBuffer>;
}
var SubtleCrypto: {
prototype: SubtleCrypto;
new (): SubtleCrypto;
}
;

Методы

decrypt(
algorithm:
| AlgorithmIdentifier
| RsaOaepParams
| AesCbcParams
| AesGcmParams
| AesCtrParams
,
key: CryptoKey,
data: BufferSource,
): Promise<ArrayBuffer>
deriveBits(
algorithm:
| AlgorithmIdentifier
| HkdfParams
| Pbkdf2Params
| EcdhKeyDeriveParams
,
baseKey: CryptoKey,
length: number,
): Promise<ArrayBuffer>
deriveKey(
algorithm:
| AlgorithmIdentifier
| HkdfParams
| Pbkdf2Params
| EcdhKeyDeriveParams
,
baseKey: CryptoKey,
derivedKeyType:
| AlgorithmIdentifier
| AesDerivedKeyParams
| HmacImportParams
| HkdfParams
| Pbkdf2Params
,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>
digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>
encrypt(
algorithm:
| AlgorithmIdentifier
| RsaOaepParams
| AesCbcParams
| AesGcmParams
| AesCtrParams
,
key: CryptoKey,
data: BufferSource,
): Promise<ArrayBuffer>
exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>
exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>
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:
| AlgorithmIdentifier
| HmacImportParams
| RsaHashedImportParams
| EcKeyImportParams
,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>
importKey(
format: Exclude<KeyFormat, "jwk">,
keyData: BufferSource,
algorithm:
| AlgorithmIdentifier
| HmacImportParams
| RsaHashedImportParams
| EcKeyImportParams
,
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:
| AlgorithmIdentifier
| RsaOaepParams
| AesCbcParams
| AesCtrParams
,
unwrappedKeyAlgorithm:
| AlgorithmIdentifier
| HmacImportParams
| RsaHashedImportParams
| EcKeyImportParams
,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>
verify(
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams,
key: CryptoKey,
signature: BufferSource,
data: BufferSource,
): Promise<boolean>
wrapKey(
format: KeyFormat,
key: CryptoKey,
wrappingKey: CryptoKey,
wrapAlgorithm:
| AlgorithmIdentifier
| RsaOaepParams
| AesCbcParams
| AesCtrParams
,
): Promise<ArrayBuffer>

© 2018–2022 the Deno authors
https://doc.deno.land/deno/stable/~/SubtleCrypto

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API