importKey
importKey is a function in the Web Crypto API, provided by the SubtleCrypto interface, used to bring external key material into a usable CryptoKey object. It returns a Promise that resolves to a CryptoKey or rejects with an error if the import fails. The method requires five parameters: format, keyData, algorithm, extractable, and keyUsages.
Format specifies how the key material is encoded and can be one of several values: "raw" for
On success, importKey yields a CryptoKey that can be used with other Web Crypto operations. On failure,
Usage considerations include ensuring the environment supports the chosen format and algorithm, and that the key