MimportKey
Bun

method

SubtleCrypto.importKey

format: 'jwk',
keyData: JsonWebKey,
algorithm: AlgorithmIdentifier | HmacImportParams | RsaHashedImportParams | EcKeyImportParams | AesKeyAlgorithm,
extractable: boolean,
keyUsages: readonly KeyUsage[]
): Promise<CryptoKey>;
format: 'spki' | 'pkcs8' | 'raw',
keyData: BufferSource,
algorithm: AlgorithmIdentifier | HmacImportParams | RsaHashedImportParams | EcKeyImportParams | AesKeyAlgorithm,
extractable: boolean,
keyUsages: KeyUsage[]
): Promise<CryptoKey>;
format: 'spki' | 'pkcs8' | 'raw',
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