wrapKeyAsync

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

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.

MDN Reference


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