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). Available only in secure contexts.
interface SubtleCrypto {
deriveKey(
algorithm: ,
baseKey: CryptoKey,
derivedKeyType: ,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>;deriveKey(
algorithm: ,
baseKey: CryptoKey,
derivedKeyType: ,
extractable: boolean,
keyUsages: Iterable<KeyUsage>,
): Promise<CryptoKey>;generateKey(
algorithm: RsaHashedKeyGenParams | EcKeyGenParams,
extractable: boolean,
keyUsages: ReadonlyArray<KeyUsage>,
): Promise<CryptoKeyPair>;generateKey(
algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params,
extractable: boolean,
keyUsages: ReadonlyArray<KeyUsage>,
): Promise<CryptoKey>;generateKey(
algorithm: AlgorithmIdentifier,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKeyPair | CryptoKey>;generateKey(
algorithm: RsaHashedKeyGenParams | EcKeyGenParams,
extractable: boolean,
keyUsages: ReadonlyArray<KeyUsage>,
): Promise<CryptoKeyPair>;generateKey(
algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params,
extractable: boolean,
keyUsages: ReadonlyArray<KeyUsage>,
): Promise<CryptoKey>;generateKey(
algorithm: AlgorithmIdentifier,
extractable: boolean,
keyUsages: Iterable<KeyUsage>,
): Promise<CryptoKeyPair | CryptoKey>;importKey(
format: "jwk",
keyData: JsonWebKey,
algorithm: ,
extractable: boolean,
keyUsages: ReadonlyArray<KeyUsage>,
): Promise<CryptoKey>;importKey(
format: Exclude<KeyFormat, "jwk">,
keyData: BufferSource,
algorithm: ,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>;importKey(
format: "jwk",
keyData: JsonWebKey,
algorithm: ,
extractable: boolean,
keyUsages: ReadonlyArray<KeyUsage>,
): Promise<CryptoKey>;importKey(
format: Exclude<KeyFormat, "jwk">,
keyData: BufferSource,
algorithm: ,
extractable: boolean,
keyUsages: Iterable<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>;unwrapKey(
format: KeyFormat,
wrappedKey: BufferSource,
unwrappingKey: CryptoKey,
unwrapAlgorithm: ,
unwrappedKeyAlgorithm: ,
extractable: boolean,
keyUsages: Iterable<KeyUsage>,
): Promise<CryptoKey>;verify(
}algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams,
key: CryptoKey,
signature: BufferSource,
data: BufferSource,
): Promise<boolean>;var SubtleCrypto: {
prototype: SubtleCrypto;
new (): SubtleCrypto;
};§Methods
§
[src]
§
§
§
[src]
§
generateKey(
[src]algorithm: RsaHashedKeyGenParams | EcKeyGenParams,
extractable: boolean,
keyUsages: ReadonlyArray<KeyUsage>,
): Promise<CryptoKeyPair>§
generateKey(
[src]algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params,
extractable: boolean,
keyUsages: ReadonlyArray<KeyUsage>,
): Promise<CryptoKey>§
generateKey(
[src]algorithm: AlgorithmIdentifier,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKeyPair | CryptoKey>§
generateKey(
[src]algorithm: RsaHashedKeyGenParams | EcKeyGenParams,
extractable: boolean,
keyUsages: ReadonlyArray<KeyUsage>,
): Promise<CryptoKeyPair>§
generateKey(
[src]algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params,
extractable: boolean,
keyUsages: ReadonlyArray<KeyUsage>,
): Promise<CryptoKey>§
generateKey(
[src]algorithm: AlgorithmIdentifier,
extractable: boolean,
keyUsages: Iterable<KeyUsage>,
): Promise<CryptoKeyPair | CryptoKey>§
importKey(
[src]format: "jwk",
keyData: JsonWebKey,
algorithm: ,
extractable: boolean,
keyUsages: ReadonlyArray<KeyUsage>,
): Promise<CryptoKey>§
importKey(
[src]format: Exclude<KeyFormat, "jwk">,
keyData: BufferSource,
algorithm: ,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>§
importKey(
[src]format: "jwk",
keyData: JsonWebKey,
algorithm: ,
extractable: boolean,
keyUsages: ReadonlyArray<KeyUsage>,
): Promise<CryptoKey>§
importKey(
[src]format: Exclude<KeyFormat, "jwk">,
keyData: BufferSource,
algorithm: ,
extractable: boolean,
keyUsages: Iterable<KeyUsage>,
): Promise<CryptoKey>§
sign(
[src]algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams,
key: CryptoKey,
data: BufferSource,
): Promise<ArrayBuffer>§
§
§
verify(
[src]algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams,
key: CryptoKey,
signature: BufferSource,
data: BufferSource,
): Promise<boolean>