Skip to content

micro509/jose ​

Optional JOSE surface: compact JWE plus signed compact JWS and JWT (RS256/384/512, ES256/384), JWK Sets, and opt-in remote JWKS resolution. Importing this entrypoint performs no network access.

Start with verifyJwt for tokens, createJwksKeyResolver for a local JWK Set, and createRemoteJwksKeyResolver to read keys from a trusted URL.

Functions ​

  • base64UrlDecode — Decodes canonical unpadded base64url, or returns undefined for invalid/noncanonical input. Empty input yields empty bytes.
  • base64UrlEncode — Encodes bytes as canonical unpadded base64url; does not encode text.
  • decryptCompactJwe — Decrypts with explicit application allowlists, bounded parsing and the supplied private key.
  • encryptCompactJwe — Encrypts one compact JWE for the limited RSA-OAEP-512/A256GCM profile (RFC 7516 §5.1).
  • createJwksKeyResolver — Creates a key resolver over a fixed JWK Set.
  • importJwkEntry — Imports a selected entry as a verify-only key for algorithm. The default remains RS256;
  • parseJwks — Parses a JWK Set document.
  • selectJwk — Selects the one key of a set that can verify selector.
  • validateJwks — Validates already parsed, plain JSON data and owns a detached deep snapshot of it.
  • parseCompactJws — Parses a compact JWS without checking its signature.
  • signCompactJws — Signs a compact JWS with an existing private CryptoKey.
  • verifyCompactJws — Verifies a compact JWS.
  • decodeJwtUnverified — Decodes a JWT without checking its signature. Every field of the result is unauthenticated.
  • signJwt — Signs a JWT. The header carries typ: "JWT" unless header.typ says otherwise.
  • verifyJwt — Verifies a JWT: the signature and tokenType policy as verifyCompactJws applies
  • createRemoteJwksKeyResolver — Creates a key resolver that reads a JWK Set from one trusted URL.

Types ​

Variables ​

Released under the MIT License.