docs/key/import/README.md
Cryptographic key import functions
| Interface | Description |
|---|---|
| KeyImportOptions | Key import options. |
| Type Alias | Description |
|---|---|
| ImportedJWK | Maps a JWK key type to the value returned by importJWK. An "oct" JWK returns Uint8Array; other supported key types return CryptoKey. A JWK whose "kty" is not statically known resolves to their union. |
| Function | Description |
|---|---|
| importJWK | Imports a JWK as a CryptoKey or Uint8Array. Asymmetric imports require either the "alg" argument or JWK "alg" parameter. For AKP keys, the JWK "alg" parameter is required and must match the argument when provided. |
| importPKCS8 | Imports a PEM-encoded PKCS#8 string as a CryptoKey. |
| importSPKI | Imports a PEM-encoded SPKI string as a CryptoKey. |
| importX509 | Imports a PEM-encoded X.509 certificate's public key as a CryptoKey. |