Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
interface Algorithm
Link copied to clipboard
Link copied to clipboard
open class Crypto

The Crypto interface represents basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives.

Link copied to clipboard
open class CryptoKey

The CryptoKey interface of the Web Crypto API represents a cryptographic key obtained from one of the SubtleCrypto methods generateKey(), deriveKey(), importKey(), or unwrapKey(). Available only in secure contexts.

Link copied to clipboard
interface CryptoKeyPair
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
sealed interface Ed25519Algorithm
Link copied to clipboard
Link copied to clipboard
interface HkdfParams : Algorithm
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
interface JsonWebKey
Link copied to clipboard
interface KeyAlgorithm
Link copied to clipboard
sealed interface KeyFormat
Link copied to clipboard
sealed interface KeyType
Link copied to clipboard
sealed interface KeyUsage
Link copied to clipboard
typealias NamedCurve = JsString
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open class SubtleCrypto

The SubtleCrypto interface of the Web Crypto API provides a number of low-level cryptographic functions. Available only in secure contexts.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
inline suspend fun SubtleCrypto.decrypt(algorithm: String, key: CryptoKey, data: BufferSource): ArrayBuffer
inline suspend fun SubtleCrypto.decrypt(algorithm: AesCbcParams, key: CryptoKey, data: BufferSource): ArrayBuffer
inline suspend fun SubtleCrypto.decrypt(algorithm: AesCtrParams, key: CryptoKey, data: BufferSource): ArrayBuffer
inline suspend fun SubtleCrypto.decrypt(algorithm: AesGcmParams, key: CryptoKey, data: BufferSource): ArrayBuffer
inline suspend fun SubtleCrypto.decrypt(algorithm: RsaOaepParams, key: CryptoKey, data: BufferSource): ArrayBuffer

inline suspend fun SubtleCrypto.decrypt(algorithm: Algorithm, key: CryptoKey, data: BufferSource): ArrayBuffer

The decrypt() method of the SubtleCrypto interface decrypts some encrypted data. It takes as arguments a key to decrypt with, some optional extra parameters, and the data to decrypt (also known as "ciphertext"). It returns a Promise which will be fulfilled with the decrypted data (also known as "plaintext").

Link copied to clipboard
inline suspend fun SubtleCrypto.deriveBits(algorithm: String, baseKey: CryptoKey): ArrayBuffer
inline suspend fun SubtleCrypto.deriveBits(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey): ArrayBuffer
inline suspend fun SubtleCrypto.deriveBits(algorithm: HkdfParams, baseKey: CryptoKey): ArrayBuffer
inline suspend fun SubtleCrypto.deriveBits(algorithm: Pbkdf2Params, baseKey: CryptoKey): ArrayBuffer
inline suspend fun SubtleCrypto.deriveBits(algorithm: String, baseKey: CryptoKey, length: Int?): ArrayBuffer
inline suspend fun SubtleCrypto.deriveBits(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, length: Int?): ArrayBuffer
inline suspend fun SubtleCrypto.deriveBits(algorithm: HkdfParams, baseKey: CryptoKey, length: Int?): ArrayBuffer
inline suspend fun SubtleCrypto.deriveBits(algorithm: Pbkdf2Params, baseKey: CryptoKey, length: Int?): ArrayBuffer

inline suspend fun SubtleCrypto.deriveBits(algorithm: Algorithm, baseKey: CryptoKey): ArrayBuffer
inline suspend fun SubtleCrypto.deriveBits(algorithm: Algorithm, baseKey: CryptoKey, length: Int?): ArrayBuffer

The deriveBits() method of the SubtleCrypto interface can be used to derive an array of bits from a base key.

Link copied to clipboard
inline suspend fun SubtleCrypto.deriveKey(algorithm: String, baseKey: CryptoKey, derivedKeyType: String, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: String, baseKey: CryptoKey, derivedKeyType: AesDerivedKeyParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: String, baseKey: CryptoKey, derivedKeyType: HkdfParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: String, baseKey: CryptoKey, derivedKeyType: HmacImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: String, baseKey: CryptoKey, derivedKeyType: Pbkdf2Params, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: AesDerivedKeyParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: HkdfParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: HmacImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: Pbkdf2Params, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, derivedKeyType: String, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, derivedKeyType: AesDerivedKeyParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, derivedKeyType: HkdfParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, derivedKeyType: HmacImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, derivedKeyType: Pbkdf2Params, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: HkdfParams, baseKey: CryptoKey, derivedKeyType: String, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: HkdfParams, baseKey: CryptoKey, derivedKeyType: AesDerivedKeyParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: HkdfParams, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: HkdfParams, baseKey: CryptoKey, derivedKeyType: HkdfParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: HkdfParams, baseKey: CryptoKey, derivedKeyType: HmacImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: HkdfParams, baseKey: CryptoKey, derivedKeyType: Pbkdf2Params, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: String, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AesDerivedKeyParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: HkdfParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: HmacImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.deriveKey(algorithm: Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: Pbkdf2Params, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey

inline suspend fun SubtleCrypto.deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey

The deriveKey() method of the SubtleCrypto interface can be used to derive a secret key from a master key.

Link copied to clipboard
inline suspend fun SubtleCrypto.digest(algorithm: String, data: BufferSource): ArrayBuffer

inline suspend fun SubtleCrypto.digest(algorithm: Algorithm, data: BufferSource): ArrayBuffer

The digest() method of the SubtleCrypto interface generates a digest of the given data, using the specified hash function. A digest is a short fixed-length value derived from some variable-length input. Cryptographic digests should exhibit collision-resistance, meaning that it's hard to come up with two different inputs that have the same digest value.

Link copied to clipboard
inline suspend fun SubtleCrypto.encrypt(algorithm: String, key: CryptoKey, data: BufferSource): ArrayBuffer
inline suspend fun SubtleCrypto.encrypt(algorithm: AesCbcParams, key: CryptoKey, data: BufferSource): ArrayBuffer
inline suspend fun SubtleCrypto.encrypt(algorithm: AesCtrParams, key: CryptoKey, data: BufferSource): ArrayBuffer
inline suspend fun SubtleCrypto.encrypt(algorithm: AesGcmParams, key: CryptoKey, data: BufferSource): ArrayBuffer
inline suspend fun SubtleCrypto.encrypt(algorithm: RsaOaepParams, key: CryptoKey, data: BufferSource): ArrayBuffer

inline suspend fun SubtleCrypto.encrypt(algorithm: Algorithm, key: CryptoKey, data: BufferSource): ArrayBuffer

The encrypt() method of the SubtleCrypto interface encrypts data.

Link copied to clipboard
inline suspend fun SubtleCrypto.exportKey(format: KeyFormat, key: CryptoKey): ArrayBuffer

inline suspend fun SubtleCrypto.exportKey(format: KeyFormat.jwk, key: CryptoKey): JsonWebKey

The exportKey() method of the SubtleCrypto interface exports a key: that is, it takes as input a CryptoKey object and gives you the key in an external, portable format.

Link copied to clipboard
inline suspend fun SubtleCrypto.generateKey(algorithm: String, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): JsAny
inline suspend fun SubtleCrypto.generateKey(algorithm: AesKeyGenParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.generateKey(algorithm: Algorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): JsAny
inline suspend fun SubtleCrypto.generateKey(algorithm: EcKeyGenParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKeyPair
inline suspend fun SubtleCrypto.generateKey(algorithm: HmacKeyGenParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.generateKey(algorithm: Pbkdf2Params, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.generateKey(algorithm: RsaHashedKeyGenParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKeyPair

inline suspend fun SubtleCrypto.generateKey(algorithm: Ed25519Algorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKeyPair

The generateKey() method of the SubtleCrypto interface is used to generate a new key (for symmetric algorithms) or key pair (for public-key algorithms).

Link copied to clipboard
inline suspend fun SubtleCrypto.importKey(format: KeyFormat, keyData: BufferSource, algorithm: String, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.importKey(format: KeyFormat, keyData: BufferSource, algorithm: AesKeyAlgorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.importKey(format: KeyFormat, keyData: BufferSource, algorithm: Algorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.importKey(format: KeyFormat, keyData: BufferSource, algorithm: EcKeyImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.importKey(format: KeyFormat, keyData: BufferSource, algorithm: HmacImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.importKey(format: KeyFormat, keyData: BufferSource, algorithm: RsaHashedImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.importKey(format: KeyFormat.jwk, keyData: JsonWebKey, algorithm: String, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.importKey(format: KeyFormat.jwk, keyData: JsonWebKey, algorithm: AesKeyAlgorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.importKey(format: KeyFormat.jwk, keyData: JsonWebKey, algorithm: EcKeyImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.importKey(format: KeyFormat.jwk, keyData: JsonWebKey, algorithm: HmacImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.importKey(format: KeyFormat.jwk, keyData: JsonWebKey, algorithm: RsaHashedImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey

inline suspend fun SubtleCrypto.importKey(format: KeyFormat.jwk, keyData: JsonWebKey, algorithm: Algorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey

The importKey() method of the SubtleCrypto interface imports a key: that is, it takes as input a key in an external, portable format and gives you a CryptoKey object that you can use in the Web Crypto API.

Link copied to clipboard
inline suspend fun SubtleCrypto.sign(algorithm: String, key: CryptoKey, data: BufferSource): ArrayBuffer
inline suspend fun SubtleCrypto.sign(algorithm: EcdsaParams, key: CryptoKey, data: BufferSource): ArrayBuffer
inline suspend fun SubtleCrypto.sign(algorithm: RsaPssParams, key: CryptoKey, data: BufferSource): ArrayBuffer

inline suspend fun SubtleCrypto.sign(algorithm: Algorithm, key: CryptoKey, data: BufferSource): ArrayBuffer

The sign() method of the SubtleCrypto interface generates a digital signature.

Link copied to clipboard
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: String, unwrappedKeyAlgorithm: String, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: String, unwrappedKeyAlgorithm: AesKeyAlgorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: String, unwrappedKeyAlgorithm: EcKeyImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: String, unwrappedKeyAlgorithm: HmacImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: String, unwrappedKeyAlgorithm: RsaHashedImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AesCbcParams, unwrappedKeyAlgorithm: String, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AesCbcParams, unwrappedKeyAlgorithm: AesKeyAlgorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AesCbcParams, unwrappedKeyAlgorithm: Algorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AesCbcParams, unwrappedKeyAlgorithm: EcKeyImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AesCbcParams, unwrappedKeyAlgorithm: HmacImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AesCbcParams, unwrappedKeyAlgorithm: RsaHashedImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AesCtrParams, unwrappedKeyAlgorithm: String, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AesCtrParams, unwrappedKeyAlgorithm: AesKeyAlgorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AesCtrParams, unwrappedKeyAlgorithm: Algorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AesCtrParams, unwrappedKeyAlgorithm: EcKeyImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AesCtrParams, unwrappedKeyAlgorithm: HmacImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AesCtrParams, unwrappedKeyAlgorithm: RsaHashedImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AesGcmParams, unwrappedKeyAlgorithm: String, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AesGcmParams, unwrappedKeyAlgorithm: AesKeyAlgorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AesGcmParams, unwrappedKeyAlgorithm: Algorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AesGcmParams, unwrappedKeyAlgorithm: EcKeyImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AesGcmParams, unwrappedKeyAlgorithm: HmacImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AesGcmParams, unwrappedKeyAlgorithm: RsaHashedImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: AesKeyAlgorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: EcKeyImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: HmacImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: RsaHashedImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: RsaOaepParams, unwrappedKeyAlgorithm: String, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: RsaOaepParams, unwrappedKeyAlgorithm: AesKeyAlgorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: RsaOaepParams, unwrappedKeyAlgorithm: Algorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: RsaOaepParams, unwrappedKeyAlgorithm: EcKeyImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: RsaOaepParams, unwrappedKeyAlgorithm: HmacImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey
inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: RsaOaepParams, unwrappedKeyAlgorithm: RsaHashedImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey

inline suspend fun SubtleCrypto.unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: Algorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): CryptoKey

The unwrapKey() method of the SubtleCrypto interface "unwraps" a key. This means that it takes as its input a key that has been exported and then encrypted (also called "wrapped"). It decrypts the key and then imports it, returning a CryptoKey object that can be used in the Web Crypto API.

Link copied to clipboard
inline suspend fun SubtleCrypto.verify(algorithm: String, key: CryptoKey, signature: BufferSource, data: BufferSource): Boolean
inline suspend fun SubtleCrypto.verify(algorithm: EcdsaParams, key: CryptoKey, signature: BufferSource, data: BufferSource): Boolean
inline suspend fun SubtleCrypto.verify(algorithm: RsaPssParams, key: CryptoKey, signature: BufferSource, data: BufferSource): Boolean

inline suspend fun SubtleCrypto.verify(algorithm: Algorithm, key: CryptoKey, signature: BufferSource, data: BufferSource): Boolean

The verify() method of the SubtleCrypto interface verifies a digital signature.

Link copied to clipboard
inline suspend fun SubtleCrypto.wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: String): ArrayBuffer
inline suspend fun SubtleCrypto.wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AesCbcParams): ArrayBuffer
inline suspend fun SubtleCrypto.wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AesCtrParams): ArrayBuffer
inline suspend fun SubtleCrypto.wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AesGcmParams): ArrayBuffer
inline suspend fun SubtleCrypto.wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: RsaOaepParams): ArrayBuffer

inline suspend fun SubtleCrypto.wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: Algorithm): ArrayBuffer

The wrapKey() method of the SubtleCrypto interface "wraps" a key. This means that it exports the key in an external, portable format, then encrypts the exported key. Wrapping a key helps protect it in untrusted environments, such as inside an otherwise unprotected data store or in transmission over an unprotected network.