Changelog
All notable changes to this project are documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.3.0 - 2026-06-29
Typed-error rework: trust-boundary functions (which consume untrusted external input) now return a Result as the strict, correct default, with an explicit unwrap() escape hatch. Typed-config constructors keep throwing (a bad config is a programmer error, not a runtime condition).
Added
unwrap(result)/unwrapOr(result, fallback)and theResultErrorclass (root +micro509/result): the explicit escape hatch for callers who have already validated input or prefer exceptions.unwrapthrows aResultErrorcarrying the structuredcode.failureResult(code, message, details?)factory inmicro509/result: one source of truth for the{ ok, error, code, message }shape.
Changed (BREAKING)
parseCertificateDer,parseCertificatePem,parseCertificateSigningRequestDer,parseCertificateSigningRequestPemnow return aResult({ ok, value }/{ ok, error: { code: 'malformed' } }) instead of throwing. Wrap withunwrap(...)for the previous throw-on-error behavior.- All 16 key
import*functions now return aResultinstead of throwing. Non-encrypted failures use code'malformed'; encrypted imports distinguish a typed'invalid_password'from'malformed'.export*andgenerateKeyPairare unchanged (no untrusted input). createPfx,createPkcs7CertBagDer, andcreatePkcs7CertBagPemnow return aResult(code'invalid_certificate') instead of throwing on a malformed certificate source — matchingcreatePkcs7SignedData. Pure typed-config constructors (createCertificate,createSelfSignedCertificate,createCertificateRevocationList, …) still throw: a bad config is a programmer error, not a runtime result.
Changed
- Canonical docs site is now
micro509.kjanat.dev(wasmicro509.kjanat.com, which stays live as a mirror).homepageand all documentation links point at the.devdomain. - GitHub repository renamed
kjanat/ts-x509→kjanat/micro509to match the published package name.repository.urlupdated; old URLs redirect.
0.2.0 - 2026-06-29
Added
- PKCS#7 / CMS
SignedDatacreation (createPkcs7SignedDataDer,createPkcs7SignedDataPem): sign content with one or more signers via the RFC 5652 §5.4 signed-attributes flow (contentType+messageDigest), producing attached SignedData that round-trips throughverifyPkcs7SignedData. The content digest is selected per signer key: SHA-256 for ECDSA P-256 and RSA-SHA256, SHA-384 for P-384, and SHA-512 for P-521 and Ed25519 (the latter per RFC 8419). Returns a typed result (no_signers/invalid_signer_certificate/unsupported_signer_key) for caller-correctable input.
0.1.1 - 2026-06-29
Maintenance release — release-pipeline fixes only, no library changes.
Fixed
- Publish workflow is gated on the test suite, authenticates npm via OIDC trusted publishing, and emits correct JSR/npm release URLs.
0.1.0 - 2026-06-29
Initial prerelease. API may change before 1.0.
Added
- X.509 certificate and CSR creation, parsing, and self-signing.
- Certificate chain verification with typed results (21 error codes, failing certificate index, structured failure details) and RFC 6125 service-identity matching (DNS, IPv6, URI-ID, SRV-ID, explicit CN opt-in).
- Revocation: CRL create/parse/verify/status and OCSP request building plus response parsing and responder-authorization checks.
- PKCS#7 / CMS
SignedDataparsing and signer-signature verification. - PFX / PKCS#12 create and parse (PBES2, PKCS#12 KDF, HMAC-SHA-256 MAC).
- PEM handling and key import/export (PKCS#8, SPKI, JWK, PKCS#1, SEC1) with generation for RSA, ECDSA (
P-256/P-384/P-521), and Ed25519. - Zero runtime dependencies, WebCrypto-native, tree-shakeable subpath exports; runs on Node, Bun, Deno, browsers, and Cloudflare Workers.