Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/jose/key/import.ts

"JSON Web Almost Everything" - JWA, JWS, JWE, JWT, JWK, JWKS with no dependencies using runtime's native crypto in Node.js, Browser, Cloudflare Workers, Electron, and Deno.
Extremely Popular
Go to Latest
import * as jose from "https://deno.land/x/jose@v3.20.4/key/import.ts";

Functions

Imports a JWK to a runtime-specific key representation (KeyLike). Either JWK "alg" (Algorithm) Parameter must be present or the optional "alg" argument. When running on a runtime using Web Cryptography API the jwk parameters "use", "key_ops", and "ext" are also used in the resulting CryptoKey. See Algorithm Key Requirements to learn about key to algorithm requirements and mapping.

Imports an PEM-encoded PKCS8 string as a runtime-specific private key representation (KeyObject or CryptoKey). See Algorithm Key Requirements to learn about key to algorithm requirements and mapping. Encrypted keys are not supported.

Imports an PEM-encoded SPKI string as a runtime-specific public key representation (KeyObject or CryptoKey). See Algorithm Key Requirements to learn about key to algorithm requirements and mapping.

Imports the SPKI from an X.509 string certificate as a runtime-specific public key representation (KeyObject or CryptoKey). See Algorithm Key Requirements to learn about key to algorithm requirements and mapping.

Interfaces

JSON Web Key (JWK). "RSA", "EC", "OKP", and "oct" key types are supported.

Type Aliases

KeyLike are runtime-specific classes representing asymmetric keys or symmetric secrets. These are instances of CryptoKey and additionally KeyObject in Node.js runtime. Uint8Array instances are also accepted as symmetric secret representation only.