$ the-wire · showcase
Web Crypto PKCS8 export now rejects public keys with InvalidAccessError
By RepoJournal · Filed · About Node.js
Node.js aligned exportKeyPkcs8() with the Web Crypto spec: exporting a public key as 'pkcs8' now throws InvalidAccessError instead of NotSupportedError.
Node.js fixed a Web Crypto conformance gap in exportKeyPkcs8() [1]: previously, exporting a public key as 'pkcs8' fell through to the generic "Unable to export ... key using pkcs8" NotSupportedError, but now it throws the spec-mandated InvalidAccessError, matching the existing behavior of exportKeySpki() for private keys. Meanwhile, two commits stabilize the build: a test now expects node:ffi to be enabled by default via the node: scheme, reverting an earlier assertion that it required --experimental-ffi, which had broken main after both changes landed independently [2]. Another test fix loosens the dgram link-local scope assertion for AIX, allowing responses with any non-empty scope ID rather than requiring a match to the destination interface [3]. On the tooling side, benchmark/scatter.js now supports an R-free --analyze option, letting you produce analysis without the R script, similar to compare.js [4]. The docs team expanded the diagnostics user journey with steps to record context before investigating and guidance on choosing a diagnostic path based on symptoms [5].
Action items
- → Review code relying on PKCS8 export of public keys to handle InvalidAccessError instead of NotSupportedError nodejs/node [plan]
- → Verify applications using node:ffi no longer need the --experimental-ffi flag nodejs/node [plan]
- → Try benchmark/scatter.js --analyze to evaluate benchmark data without the R dependency nodejs/node [monitor]
References
- [1] crypto: fix public PKCS8 export error ↗ nodejs/node
- [2] test: expect node:ffi to be enabled by default ↗ nodejs/node
- [3] test: fix link-local dgram scope assertion ↗ nodejs/node
- [4] benchmark: add --analyze option to benchmark/scatter.js ↗ nodejs/node
- [5] docs: improve diagnostics user journey ↗ nodejs/learn