Interface SubtleCrypto
interface SubtleCrypto {
decrypt(
algorithm:
| AesCbcParams
| AesCtrParams
| AesGcmParams
| AlgorithmIdentifier
| RsaOaepParams,
key: CryptoKey,
data: BufferSource,
): Promise<ArrayBuffer>;
deriveBits(
algorithm:
| EcdhKeyDeriveParams
| AlgorithmIdentifier
| HkdfParams
| Pbkdf2Params,
baseKey: CryptoKey,
length?: number,
): Promise<ArrayBuffer>;
deriveKey(
algorithm:
| EcdhKeyDeriveParams
| AlgorithmIdentifier
| HkdfParams
| Pbkdf2Params,
baseKey: CryptoKey,
derivedKeyType:
| AesDerivedKeyParams
| AlgorithmIdentifier
| HkdfParams
| HmacImportParams
| Pbkdf2Params,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>;
deriveKey(
algorithm:
| EcdhKeyDeriveParams
| AlgorithmIdentifier
| HkdfParams
| Pbkdf2Params,
baseKey: CryptoKey,
derivedKeyType:
| AesDerivedKeyParams
| AlgorithmIdentifier
| HkdfParams
| HmacImportParams
| Pbkdf2Params,
extractable: boolean,
keyUsages: Iterable<KeyUsage>,
): Promise<CryptoKey>;
digest(
algorithm: AlgorithmIdentifier,
data: BufferSource,
): Promise<ArrayBuffer>;
encrypt(
algorithm:
| AesCbcParams
| AesCtrParams
| AesGcmParams
| AlgorithmIdentifier
| RsaOaepParams,
key: CryptoKey,
data: BufferSource,
): Promise<ArrayBuffer>;
exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
exportKey(
format: "raw" | "pkcs8" | "spki",
key: CryptoKey,
): Promise<ArrayBuffer>;
exportKey(
format: KeyFormat,
key: CryptoKey,
): Promise<ArrayBuffer | JsonWebKey>;
generateKey(
algorithm: "Ed25519",
extractable: boolean,
keyUsages: readonly ("sign" | "verify")[],
): Promise<CryptoKeyPair>;
generateKey(
algorithm: EcKeyGenParams | RsaHashedKeyGenParams,
extractable: boolean,
keyUsages: readonly KeyUsage[],
): Promise<CryptoKeyPair>;
generateKey(
algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params,
extractable: boolean,
keyUsages: readonly KeyUsage[],
): Promise<CryptoKey>;
generateKey(
algorithm: AlgorithmIdentifier,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey | CryptoKeyPair>;
generateKey(
algorithm: "Ed25519",
extractable: boolean,
keyUsages: readonly ("sign" | "verify")[],
): Promise<CryptoKeyPair>;
generateKey(
algorithm: EcKeyGenParams | RsaHashedKeyGenParams,
extractable: boolean,
keyUsages: readonly KeyUsage[],
): Promise<CryptoKeyPair>;
generateKey(
algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params,
extractable: boolean,
keyUsages: readonly KeyUsage[],
): Promise<CryptoKey>;
generateKey(
algorithm: AlgorithmIdentifier,
extractable: boolean,
keyUsages: Iterable<KeyUsage>,
): Promise<CryptoKey | CryptoKeyPair>;
importKey(
format: "jwk",
keyData: JsonWebKey,
algorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams,
extractable: boolean,
keyUsages: readonly KeyUsage[],
): Promise<CryptoKey>;
importKey(
format: "raw" | "pkcs8" | "spki",
keyData: BufferSource,
algorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>;
importKey(
format: "jwk",
keyData: JsonWebKey,
algorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams,
extractable: boolean,
keyUsages: readonly KeyUsage[],
): Promise<CryptoKey>;
importKey(
format: "raw" | "pkcs8" | "spki",
keyData: BufferSource,
algorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams,
extractable: boolean,
keyUsages: Iterable<KeyUsage>,
): Promise<CryptoKey>;
sign(
algorithm: EcdsaParams | AlgorithmIdentifier | RsaPssParams,
key: CryptoKey,
data: BufferSource,
): Promise<ArrayBuffer>;
unwrapKey(
format: KeyFormat,
wrappedKey: BufferSource,
unwrappingKey: CryptoKey,
unwrapAlgorithm:
| AesCbcParams
| AesCtrParams
| AesGcmParams
| AlgorithmIdentifier
| RsaOaepParams,
unwrappedKeyAlgorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>;
unwrapKey(
format: KeyFormat,
wrappedKey: BufferSource,
unwrappingKey: CryptoKey,
unwrapAlgorithm:
| AesCbcParams
| AesCtrParams
| AesGcmParams
| AlgorithmIdentifier
| RsaOaepParams,
unwrappedKeyAlgorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams,
extractable: boolean,
keyUsages: Iterable<KeyUsage>,
): Promise<CryptoKey>;
verify(
algorithm: EcdsaParams | AlgorithmIdentifier | RsaPssParams,
key: CryptoKey,
signature: BufferSource,
data: BufferSource,
): Promise<boolean>;
wrapKey(
format: KeyFormat,
key: CryptoKey,
wrappingKey: CryptoKey,
wrapAlgorithm:
| AesCbcParams
| AesCtrParams
| AesGcmParams
| AlgorithmIdentifier
| RsaOaepParams,
): Promise<ArrayBuffer>;
}
decrypt(
algorithm:
| AesCbcParams
| AesCtrParams
| AesGcmParams
| AlgorithmIdentifier
| RsaOaepParams,
key: CryptoKey,
data: BufferSource,
): Promise<ArrayBuffer>;
deriveBits(
algorithm:
| EcdhKeyDeriveParams
| AlgorithmIdentifier
| HkdfParams
| Pbkdf2Params,
baseKey: CryptoKey,
length?: number,
): Promise<ArrayBuffer>;
deriveKey(
algorithm:
| EcdhKeyDeriveParams
| AlgorithmIdentifier
| HkdfParams
| Pbkdf2Params,
baseKey: CryptoKey,
derivedKeyType:
| AesDerivedKeyParams
| AlgorithmIdentifier
| HkdfParams
| HmacImportParams
| Pbkdf2Params,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>;
deriveKey(
algorithm:
| EcdhKeyDeriveParams
| AlgorithmIdentifier
| HkdfParams
| Pbkdf2Params,
baseKey: CryptoKey,
derivedKeyType:
| AesDerivedKeyParams
| AlgorithmIdentifier
| HkdfParams
| HmacImportParams
| Pbkdf2Params,
extractable: boolean,
keyUsages: Iterable<KeyUsage>,
): Promise<CryptoKey>;
digest(
algorithm: AlgorithmIdentifier,
data: BufferSource,
): Promise<ArrayBuffer>;
encrypt(
algorithm:
| AesCbcParams
| AesCtrParams
| AesGcmParams
| AlgorithmIdentifier
| RsaOaepParams,
key: CryptoKey,
data: BufferSource,
): Promise<ArrayBuffer>;
exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
exportKey(
format: "raw" | "pkcs8" | "spki",
key: CryptoKey,
): Promise<ArrayBuffer>;
exportKey(
format: KeyFormat,
key: CryptoKey,
): Promise<ArrayBuffer | JsonWebKey>;
generateKey(
algorithm: "Ed25519",
extractable: boolean,
keyUsages: readonly ("sign" | "verify")[],
): Promise<CryptoKeyPair>;
generateKey(
algorithm: EcKeyGenParams | RsaHashedKeyGenParams,
extractable: boolean,
keyUsages: readonly KeyUsage[],
): Promise<CryptoKeyPair>;
generateKey(
algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params,
extractable: boolean,
keyUsages: readonly KeyUsage[],
): Promise<CryptoKey>;
generateKey(
algorithm: AlgorithmIdentifier,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey | CryptoKeyPair>;
generateKey(
algorithm: "Ed25519",
extractable: boolean,
keyUsages: readonly ("sign" | "verify")[],
): Promise<CryptoKeyPair>;
generateKey(
algorithm: EcKeyGenParams | RsaHashedKeyGenParams,
extractable: boolean,
keyUsages: readonly KeyUsage[],
): Promise<CryptoKeyPair>;
generateKey(
algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params,
extractable: boolean,
keyUsages: readonly KeyUsage[],
): Promise<CryptoKey>;
generateKey(
algorithm: AlgorithmIdentifier,
extractable: boolean,
keyUsages: Iterable<KeyUsage>,
): Promise<CryptoKey | CryptoKeyPair>;
importKey(
format: "jwk",
keyData: JsonWebKey,
algorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams,
extractable: boolean,
keyUsages: readonly KeyUsage[],
): Promise<CryptoKey>;
importKey(
format: "raw" | "pkcs8" | "spki",
keyData: BufferSource,
algorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>;
importKey(
format: "jwk",
keyData: JsonWebKey,
algorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams,
extractable: boolean,
keyUsages: readonly KeyUsage[],
): Promise<CryptoKey>;
importKey(
format: "raw" | "pkcs8" | "spki",
keyData: BufferSource,
algorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams,
extractable: boolean,
keyUsages: Iterable<KeyUsage>,
): Promise<CryptoKey>;
sign(
algorithm: EcdsaParams | AlgorithmIdentifier | RsaPssParams,
key: CryptoKey,
data: BufferSource,
): Promise<ArrayBuffer>;
unwrapKey(
format: KeyFormat,
wrappedKey: BufferSource,
unwrappingKey: CryptoKey,
unwrapAlgorithm:
| AesCbcParams
| AesCtrParams
| AesGcmParams
| AlgorithmIdentifier
| RsaOaepParams,
unwrappedKeyAlgorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey>;
unwrapKey(
format: KeyFormat,
wrappedKey: BufferSource,
unwrappingKey: CryptoKey,
unwrapAlgorithm:
| AesCbcParams
| AesCtrParams
| AesGcmParams
| AlgorithmIdentifier
| RsaOaepParams,
unwrappedKeyAlgorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams,
extractable: boolean,
keyUsages: Iterable<KeyUsage>,
): Promise<CryptoKey>;
verify(
algorithm: EcdsaParams | AlgorithmIdentifier | RsaPssParams,
key: CryptoKey,
signature: BufferSource,
data: BufferSource,
): Promise<boolean>;
wrapKey(
format: KeyFormat,
key: CryptoKey,
wrappingKey: CryptoKey,
wrapAlgorithm:
| AesCbcParams
| AesCtrParams
| AesGcmParams
| AlgorithmIdentifier
| RsaOaepParams,
): Promise<ArrayBuffer>;
}
Methods
decrypt
- decrypt(
algorithm:
| AesCbcParams
| AesCtrParams
| AesGcmParams
| AlgorithmIdentifier
| RsaOaepParams,
key: CryptoKey,
data: BufferSource,
): Promise<ArrayBuffer> Parameters
- algorithm: AesCbcParams | AesCtrParams | AesGcmParams | AlgorithmIdentifier | RsaOaepParams
- key: CryptoKey
- data: BufferSource
Returns Promise<ArrayBuffer>
deriveBits
- deriveBits(
algorithm:
| EcdhKeyDeriveParams
| AlgorithmIdentifier
| HkdfParams
| Pbkdf2Params,
baseKey: CryptoKey,
length?: number,
): Promise<ArrayBuffer> Parameters
- algorithm: EcdhKeyDeriveParams | AlgorithmIdentifier | HkdfParams | Pbkdf2Params
- baseKey: CryptoKey
Optional
length: number
Returns Promise<ArrayBuffer>
deriveKey
- deriveKey(
algorithm:
| EcdhKeyDeriveParams
| AlgorithmIdentifier
| HkdfParams
| Pbkdf2Params,
baseKey: CryptoKey,
derivedKeyType:
| AesDerivedKeyParams
| AlgorithmIdentifier
| HkdfParams
| HmacImportParams
| Pbkdf2Params,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey> Parameters
- algorithm: EcdhKeyDeriveParams | AlgorithmIdentifier | HkdfParams | Pbkdf2Params
- baseKey: CryptoKey
- derivedKeyType:
| AesDerivedKeyParams
| AlgorithmIdentifier
| HkdfParams
| HmacImportParams
| Pbkdf2Params - extractable: boolean
- keyUsages: KeyUsage[]
Returns Promise<CryptoKey>
- deriveKey(
algorithm:
| EcdhKeyDeriveParams
| AlgorithmIdentifier
| HkdfParams
| Pbkdf2Params,
baseKey: CryptoKey,
derivedKeyType:
| AesDerivedKeyParams
| AlgorithmIdentifier
| HkdfParams
| HmacImportParams
| Pbkdf2Params,
extractable: boolean,
keyUsages: Iterable<KeyUsage>,
): Promise<CryptoKey> Parameters
- algorithm: EcdhKeyDeriveParams | AlgorithmIdentifier | HkdfParams | Pbkdf2Params
- baseKey: CryptoKey
- derivedKeyType:
| AesDerivedKeyParams
| AlgorithmIdentifier
| HkdfParams
| HmacImportParams
| Pbkdf2Params - extractable: boolean
- keyUsages: Iterable<KeyUsage>
Returns Promise<CryptoKey>
digest
- digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>
Parameters
- algorithm: AlgorithmIdentifier
- data: BufferSource
Returns Promise<ArrayBuffer>
encrypt
- encrypt(
algorithm:
| AesCbcParams
| AesCtrParams
| AesGcmParams
| AlgorithmIdentifier
| RsaOaepParams,
key: CryptoKey,
data: BufferSource,
): Promise<ArrayBuffer> Parameters
- algorithm: AesCbcParams | AesCtrParams | AesGcmParams | AlgorithmIdentifier | RsaOaepParams
- key: CryptoKey
- data: BufferSource
Returns Promise<ArrayBuffer>
exportKey
- exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>
Parameters
- format: "jwk"
- key: CryptoKey
Returns Promise<JsonWebKey>
- exportKey(
format: "raw" | "pkcs8" | "spki",
key: CryptoKey,
): Promise<ArrayBuffer> Parameters
- format: "raw" | "pkcs8" | "spki"
- key: CryptoKey
Returns Promise<ArrayBuffer>
- exportKey(format: KeyFormat, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>
Returns Promise<ArrayBuffer | JsonWebKey>
generateKey
- generateKey(
algorithm: "Ed25519",
extractable: boolean,
keyUsages: readonly ("sign" | "verify")[],
): Promise<CryptoKeyPair> Parameters
- algorithm: "Ed25519"
- extractable: boolean
- keyUsages: readonly ("sign" | "verify")[]
Returns Promise<CryptoKeyPair>
- generateKey(
algorithm: EcKeyGenParams | RsaHashedKeyGenParams,
extractable: boolean,
keyUsages: readonly KeyUsage[],
): Promise<CryptoKeyPair> Parameters
- algorithm: EcKeyGenParams | RsaHashedKeyGenParams
- extractable: boolean
- keyUsages: readonly KeyUsage[]
Returns Promise<CryptoKeyPair>
- generateKey(
algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params,
extractable: boolean,
keyUsages: readonly KeyUsage[],
): Promise<CryptoKey> Parameters
- algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params
- extractable: boolean
- keyUsages: readonly KeyUsage[]
Returns Promise<CryptoKey>
- generateKey(
algorithm: AlgorithmIdentifier,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey | CryptoKeyPair> Parameters
- algorithm: AlgorithmIdentifier
- extractable: boolean
- keyUsages: KeyUsage[]
Returns Promise<CryptoKey | CryptoKeyPair>
- generateKey(
algorithm: "Ed25519",
extractable: boolean,
keyUsages: readonly ("sign" | "verify")[],
): Promise<CryptoKeyPair> Parameters
- algorithm: "Ed25519"
- extractable: boolean
- keyUsages: readonly ("sign" | "verify")[]
Returns Promise<CryptoKeyPair>
- generateKey(
algorithm: EcKeyGenParams | RsaHashedKeyGenParams,
extractable: boolean,
keyUsages: readonly KeyUsage[],
): Promise<CryptoKeyPair> Parameters
- algorithm: EcKeyGenParams | RsaHashedKeyGenParams
- extractable: boolean
- keyUsages: readonly KeyUsage[]
Returns Promise<CryptoKeyPair>
- generateKey(
algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params,
extractable: boolean,
keyUsages: readonly KeyUsage[],
): Promise<CryptoKey> Parameters
- algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params
- extractable: boolean
- keyUsages: readonly KeyUsage[]
Returns Promise<CryptoKey>
- generateKey(
algorithm: AlgorithmIdentifier,
extractable: boolean,
keyUsages: Iterable<KeyUsage>,
): Promise<CryptoKey | CryptoKeyPair> Parameters
- algorithm: AlgorithmIdentifier
- extractable: boolean
- keyUsages: Iterable<KeyUsage>
Returns Promise<CryptoKey | CryptoKeyPair>
importKey
- importKey(
format: "jwk",
keyData: JsonWebKey,
algorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams,
extractable: boolean,
keyUsages: readonly KeyUsage[],
): Promise<CryptoKey> Parameters
- format: "jwk"
- keyData: JsonWebKey
- algorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams - extractable: boolean
- keyUsages: readonly KeyUsage[]
Returns Promise<CryptoKey>
- importKey(
format: "raw" | "pkcs8" | "spki",
keyData: BufferSource,
algorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey> Parameters
- format: "raw" | "pkcs8" | "spki"
- keyData: BufferSource
- algorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams - extractable: boolean
- keyUsages: KeyUsage[]
Returns Promise<CryptoKey>
- importKey(
format: "jwk",
keyData: JsonWebKey,
algorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams,
extractable: boolean,
keyUsages: readonly KeyUsage[],
): Promise<CryptoKey> Parameters
- format: "jwk"
- keyData: JsonWebKey
- algorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams - extractable: boolean
- keyUsages: readonly KeyUsage[]
Returns Promise<CryptoKey>
- importKey(
format: "raw" | "pkcs8" | "spki",
keyData: BufferSource,
algorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams,
extractable: boolean,
keyUsages: Iterable<KeyUsage>,
): Promise<CryptoKey> Parameters
- format: "raw" | "pkcs8" | "spki"
- keyData: BufferSource
- algorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams - extractable: boolean
- keyUsages: Iterable<KeyUsage>
Returns Promise<CryptoKey>
sign
- sign(
algorithm: EcdsaParams | AlgorithmIdentifier | RsaPssParams,
key: CryptoKey,
data: BufferSource,
): Promise<ArrayBuffer> Parameters
- algorithm: EcdsaParams | AlgorithmIdentifier | RsaPssParams
- key: CryptoKey
- data: BufferSource
Returns Promise<ArrayBuffer>
unwrapKey
- unwrapKey(
format: KeyFormat,
wrappedKey: BufferSource,
unwrappingKey: CryptoKey,
unwrapAlgorithm:
| AesCbcParams
| AesCtrParams
| AesGcmParams
| AlgorithmIdentifier
| RsaOaepParams,
unwrappedKeyAlgorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams,
extractable: boolean,
keyUsages: KeyUsage[],
): Promise<CryptoKey> Parameters
- format: KeyFormat
- wrappedKey: BufferSource
- unwrappingKey: CryptoKey
- unwrapAlgorithm: AesCbcParams | AesCtrParams | AesGcmParams | AlgorithmIdentifier | RsaOaepParams
- unwrappedKeyAlgorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams - extractable: boolean
- keyUsages: KeyUsage[]
Returns Promise<CryptoKey>
- unwrapKey(
format: KeyFormat,
wrappedKey: BufferSource,
unwrappingKey: CryptoKey,
unwrapAlgorithm:
| AesCbcParams
| AesCtrParams
| AesGcmParams
| AlgorithmIdentifier
| RsaOaepParams,
unwrappedKeyAlgorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams,
extractable: boolean,
keyUsages: Iterable<KeyUsage>,
): Promise<CryptoKey> Parameters
- format: KeyFormat
- wrappedKey: BufferSource
- unwrappingKey: CryptoKey
- unwrapAlgorithm: AesCbcParams | AesCtrParams | AesGcmParams | AlgorithmIdentifier | RsaOaepParams
- unwrappedKeyAlgorithm:
| AesKeyAlgorithm
| AlgorithmIdentifier
| EcKeyImportParams
| HmacImportParams
| RsaHashedImportParams - extractable: boolean
- keyUsages: Iterable<KeyUsage>
Returns Promise<CryptoKey>
verify
- verify(
algorithm: EcdsaParams | AlgorithmIdentifier | RsaPssParams,
key: CryptoKey,
signature: BufferSource,
data: BufferSource,
): Promise<boolean> Parameters
- algorithm: EcdsaParams | AlgorithmIdentifier | RsaPssParams
- key: CryptoKey
- signature: BufferSource
- data: BufferSource
Returns Promise<boolean>
wrapKey
- wrapKey(
format: KeyFormat,
key: CryptoKey,
wrappingKey: CryptoKey,
wrapAlgorithm:
| AesCbcParams
| AesCtrParams
| AesGcmParams
| AlgorithmIdentifier
| RsaOaepParams,
): Promise<ArrayBuffer> Parameters
- format: KeyFormat
- key: CryptoKey
- wrappingKey: CryptoKey
- wrapAlgorithm: AesCbcParams | AesCtrParams | AesGcmParams | AlgorithmIdentifier | RsaOaepParams
Returns Promise<ArrayBuffer>
MDN Reference