Repository navigation
refactor(deps): replace webcrypto-core converters with @peculiar/utils 4.1 - #98
Merged
Merged
Conversation
donskov
force-pushed
the
donskov/webcrypto-4-build
branch
2 times, most recently
from
October 27, 2026 11:07
7a1d61c to
1f210fb
Compare
…s 4.1 Ed25519/X25519 keys use pem.decodeFirst/pem.encode from @peculiar/utils/pem instead of core.PemConverter, and HKDF and Ed25519 use toArrayBuffer/toUint8Array instead of core.BufferSourceConverter. webcrypto-core 2 no longer exports either class, so this keeps the core upgrade small. @peculiar/utils moves from ^2.0.2 to ^4.1.0 (root and subpath API only, no /legacy). No behavior change: the PEM text is internal (Node.js KeyObject exports and our own encode), and every such input decodes to the same bytes as before. New specs pin it: pkcs8/spki export equals Node.js DER, byte-for-byte round trips, JWK -> pkcs8. Also covered: HKDF against RFC 5869 with offset views, and the base64url rules for JWK members (unpadded only; padding, +/ and invalid characters rejected), which match 1.7.1.
donskov
force-pushed
the
donskov/webcrypto-5-utils
branch
from
October 27, 2026 11:10
e5d2030 to
640fb71
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #97 (part 5 of 7 for @peculiar/webcrypto 2.0.0; merge in order).
core.PemConverter→pem.decodeFirst/pem.encodefrom@peculiar/utils/pem(Ed25519/X25519 PEM storage, 6 call sites);core.BufferSourceConverter→toArrayBuffer/toUint8Array(HKDF from@peculiar/utils/bytes, Ed25519 sign from the root import the file already used).@peculiar/utils^2.0.2→^4.1.0, root and subpaths only, no/legacy. It runs next to webcrypto-core 1 (which keeps its own stateless utils 2 copy), so the core bump in PR 6 needs no code changes.KeyObject.export({ format: "pem" })or our ownencode, and every such input decodes to the same bytes as before (see the comparison table in the summary). New specs (pass on the old and new code): pkcs8/spki export equals Node.js DER, byte-for-byte round trips, JWK → pkcs8, HKDF RFC 5869 with offset views, JWK base64url rules (unpadded only).Placed after
build!so master never ships a CommonJS build thatrequire()s the ESM-only utils 4 while declaring>=14.18.0.