Back to Jose

key/import

docs/key/import/README.md

6.2.121.6 KB
Original Source

key/import

Cryptographic key import functions

Interfaces

InterfaceDescription
KeyImportOptionsKey import options.

Type Aliases

Type AliasDescription
ImportedJWKMaps 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.

Functions

FunctionDescription
importJWKImports 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.
importPKCS8Imports a PEM-encoded PKCS#8 string as a CryptoKey.
importSPKIImports a PEM-encoded SPKI string as a CryptoKey.
importX509Imports a PEM-encoded X.509 certificate's public key as a CryptoKey.