importKey

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

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.

MDN Reference


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