npm / pkijs
pkijs
What changed in pkijs 3 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-22.
13 breaking1 security10 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initpkijs 413 changes
Breaking changes 11
asn1js is now a peer dependency; install it next to pkijs and use the same copy, since values built with asn1js 3 fail instanceof checks.
Constructing a new CertificateChainValidationEngine with null throws a TypeError.
fromJSON() throws a TypeError when a JWK member isn't base64url.
The CommonJS build is removed and the package ships a single ES module at build/index.js; supported Node.js can still require pkijs through require(esm).
The new exports map blocks deep imports into build/.
TypeScript projects that compile to CommonJS need to set module to node20 or nodenext.
The minimum supported Node.js versions are ^20.19.0 or >=22.12.0; older versions, including 22.0–22.11, are no longer supported.
toString() accepts only hex, base64, and base64url.
fromJSON() throws a TypeError when a JWK member isn't base64url.
Serialization throws a RangeError for an invalid or pre-1970 timestamp.
verify() throws a TypeError when the log key isn't base64.
Fixes and other changes 2
JWK n and e are decoded exactly.
Timestamp tokens are verified with a constructed eContent.
pkijs 311 changes
Breaking changes 2
The build now requires Node.js >= 24.5.0 and npm 11.7.0.
SignedCertificateTimestamp.signature is now an ArrayBuffer.
Security 1
OCSP responder authorization checks are now performed in accordance with RFC 6960 §4.2.2.2.
Fixes and other changes 8
ECDSA r and s are encoded as minimal DER INTEGERs.
SCT timestamp verification no longer mutates certificates.
KeyTrans recipient encryption errors are now propagated.
Uses a safe global registry key when process.pid is not an integer.
RSA-PSS public key import now accepts id-RSASSA-PSS SubjectPublicKeyInfo.
Parse OCSP SingleResponse singleExtensions as [1] EXPLICIT.
Parse singleRequestExtensions as [0] EXPLICIT Extensions.
Crypto detection was fixed.