interface 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).

Methods

generateKey(
algorithm: RsaHashedKeyGenParams | EcKeyGenParams,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKeyPair>
[src]
generateKey(
algorithm: AesKeyGenParams | HmacKeyGenParams,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>
[src]
generateKey(
algorithm: AlgorithmIdentifier,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKeyPair | CryptoKey>
[src]
importKey(
format: "jwk",
keyData: JsonWebKey,
algorithm:
| AlgorithmIdentifier
| HmacImportParams
| RsaHashedImportParams
| EcKeyImportParams
,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>
[src]
importKey(
format: Exclude<KeyFormat, "jwk">,
keyData: BufferSource,
algorithm:
| AlgorithmIdentifier
| HmacImportParams
| RsaHashedImportParams
| EcKeyImportParams
,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>
[src]
exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>[src]
exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>[src]
sign(
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams,
key: CryptoKey,
data: BufferSource,
): Promise<ArrayBuffer>
[src]
verify(
algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams,
key: CryptoKey,
signature: BufferSource,
data: BufferSource,
): Promise<boolean>
[src]
digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>[src]
encrypt(
algorithm:
| AlgorithmIdentifier
| RsaOaepParams
| AesCbcParams
| AesGcmParams
| AesCtrParams
,
key: CryptoKey,
data: BufferSource,
): Promise<ArrayBuffer>
[src]
decrypt(
algorithm:
| AlgorithmIdentifier
| RsaOaepParams
| AesCbcParams
| AesGcmParams
| AesCtrParams
,
key: CryptoKey,
data: BufferSource,
): Promise<ArrayBuffer>
[src]
deriveBits(
algorithm:
| AlgorithmIdentifier
| HkdfParams
| Pbkdf2Params
| EcdhKeyDeriveParams
,
baseKey: CryptoKey,
length: number,
): Promise<ArrayBuffer>
[src]
deriveKey(
algorithm:
| AlgorithmIdentifier
| HkdfParams
| Pbkdf2Params
| EcdhKeyDeriveParams
,
baseKey: CryptoKey,
derivedKeyType:
| AlgorithmIdentifier
| AesDerivedKeyParams
| HmacImportParams
| HkdfParams
| Pbkdf2Params
,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>
[src]
wrapKey(
format: KeyFormat,
key: CryptoKey,
wrappingKey: CryptoKey,
wrapAlgorithm:
| AlgorithmIdentifier
| RsaOaepParams
| AesCbcParams
| AesCtrParams
,
): Promise<ArrayBuffer>
[src]
unwrapKey(
format: KeyFormat,
wrappedKey: BufferSource,
unwrappingKey: CryptoKey,
unwrapAlgorithm:
| AlgorithmIdentifier
| RsaOaepParams
| AesCbcParams
| AesCtrParams
,
unwrappedKeyAlgorithm:
| AlgorithmIdentifier
| HmacImportParams
| RsaHashedImportParams
| EcKeyImportParams
,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>
[src]
variable SubtleCrypto
{ prototype: SubtleCrypto; new (): SubtleCrypto; }[src]