importKey

Bun

Symbol

SubtleCrypto.importKey

importKey(format: 'jwk', keyData: JsonWebKey, algorithm: AlgorithmIdentifier | HmacImportParams | RsaHashedImportParams | EcKeyImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>
importKey(format: 'pkcs8' | 'raw' | 'spki', keyData: BufferSource, algorithm: AlgorithmIdentifier | HmacImportParams | RsaHashedImportParams | EcKeyImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>
importKey(format: 'pkcs8' | 'raw' | 'spki', keyData: BufferSource, algorithm: AlgorithmIdentifier | HmacImportParams | RsaHashedImportParams | EcKeyImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>

Referenced types

class CryptoKey

The CryptoKey dictionary of the Web Crypto API represents a cryptographic key. Available only in secure contexts.

MDN Reference