SubtleCrypto

open class SubtleCrypto(source)

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

MDN Reference

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.

Link copied to clipboard

The decrypt() method of the SubtleCrypto interface decrypts some encrypted data.

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
fun deriveBitsAsync(algorithm: String, baseKey: CryptoKey, length: Int? = definedExternally): Promise<ArrayBuffer>
fun deriveBitsAsync(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, length: Int? = definedExternally): Promise<ArrayBuffer>
fun deriveBitsAsync(algorithm: HkdfParams, baseKey: CryptoKey, length: Int? = definedExternally): Promise<ArrayBuffer>
fun deriveBitsAsync(algorithm: Pbkdf2Params, baseKey: CryptoKey, length: Int? = definedExternally): Promise<ArrayBuffer>

fun deriveBitsAsync(algorithm: Algorithm, baseKey: CryptoKey, length: Int? = definedExternally): Promise<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
fun deriveKeyAsync(algorithm: String, baseKey: CryptoKey, derivedKeyType: String, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: String, baseKey: CryptoKey, derivedKeyType: AesDerivedKeyParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: String, baseKey: CryptoKey, derivedKeyType: HkdfParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: String, baseKey: CryptoKey, derivedKeyType: HmacImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: String, baseKey: CryptoKey, derivedKeyType: Pbkdf2Params, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: AesDerivedKeyParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: HkdfParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: HmacImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: Pbkdf2Params, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, derivedKeyType: String, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, derivedKeyType: AesDerivedKeyParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, derivedKeyType: HkdfParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, derivedKeyType: HmacImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, derivedKeyType: Pbkdf2Params, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: HkdfParams, baseKey: CryptoKey, derivedKeyType: String, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: HkdfParams, baseKey: CryptoKey, derivedKeyType: AesDerivedKeyParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: HkdfParams, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: HkdfParams, baseKey: CryptoKey, derivedKeyType: HkdfParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: HkdfParams, baseKey: CryptoKey, derivedKeyType: HmacImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: HkdfParams, baseKey: CryptoKey, derivedKeyType: Pbkdf2Params, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: String, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AesDerivedKeyParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: HkdfParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: HmacImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun deriveKeyAsync(algorithm: Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: Pbkdf2Params, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>

fun deriveKeyAsync(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<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.

Link copied to clipboard

The digest() method of the SubtleCrypto interface generates a digest of the given data, using the specified hash function.

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

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

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
fun generateKeyAsync(algorithm: String, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<JsAny>
fun generateKeyAsync(algorithm: AesKeyGenParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun generateKeyAsync(algorithm: Algorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<JsAny>
fun generateKeyAsync(algorithm: HmacKeyGenParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun generateKeyAsync(algorithm: Pbkdf2Params, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>

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
fun importKeyAsync(format: KeyFormat, keyData: BufferSource, algorithm: String, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun importKeyAsync(format: KeyFormat, keyData: BufferSource, algorithm: AesKeyAlgorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun importKeyAsync(format: KeyFormat, keyData: BufferSource, algorithm: Algorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun importKeyAsync(format: KeyFormat, keyData: BufferSource, algorithm: EcKeyImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun importKeyAsync(format: KeyFormat, keyData: BufferSource, algorithm: HmacImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun importKeyAsync(format: KeyFormat, keyData: BufferSource, algorithm: RsaHashedImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun importKeyAsync(format: KeyFormat.jwk, keyData: JsonWebKey, algorithm: String, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun importKeyAsync(format: KeyFormat.jwk, keyData: JsonWebKey, algorithm: AesKeyAlgorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun importKeyAsync(format: KeyFormat.jwk, keyData: JsonWebKey, algorithm: EcKeyImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun importKeyAsync(format: KeyFormat.jwk, keyData: JsonWebKey, algorithm: HmacImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>
fun importKeyAsync(format: KeyFormat.jwk, keyData: JsonWebKey, algorithm: RsaHashedImportParams, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>

fun importKeyAsync(format: KeyFormat.jwk, keyData: JsonWebKey, algorithm: Algorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<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
fun signAsync(algorithm: String, key: CryptoKey, data: BufferSource): Promise<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.

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

fun unwrapKeyAsync(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: Algorithm, extractable: Boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>

The unwrapKey() method of the SubtleCrypto interface 'unwraps' a key.

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
fun verifyAsync(algorithm: String, key: CryptoKey, signature: BufferSource, data: BufferSource): Promise<JsBoolean>
fun verifyAsync(algorithm: EcdsaParams, key: CryptoKey, signature: BufferSource, data: BufferSource): Promise<JsBoolean>
fun verifyAsync(algorithm: RsaPssParams, key: CryptoKey, signature: BufferSource, data: BufferSource): Promise<JsBoolean>

fun verifyAsync(algorithm: Algorithm, key: CryptoKey, signature: BufferSource, data: BufferSource): Promise<JsBoolean>

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.

Link copied to clipboard
fun wrapKeyAsync(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: String): Promise<ArrayBuffer>
fun wrapKeyAsync(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AesCbcParams): Promise<ArrayBuffer>
fun wrapKeyAsync(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AesCtrParams): Promise<ArrayBuffer>
fun wrapKeyAsync(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AesGcmParams): Promise<ArrayBuffer>
fun wrapKeyAsync(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: RsaOaepParams): Promise<ArrayBuffer>

fun wrapKeyAsync(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: Algorithm): Promise<ArrayBuffer>

The wrapKey() method of the SubtleCrypto interface 'wraps' a key.