Skip to content

[codex] expose X509 extension metadata#4241

Merged
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-x509-extension-metadata
Jun 3, 2026
Merged

[codex] expose X509 extension metadata#4241
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-x509-extension-metadata

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

Summary

Refs #2563.

Adds a focused X509Certificate extension-metadata slice:

  • exposes X509Certificate#subjectAltName for deterministic DNS/IP/email/URI SAN entries
  • exposes X509Certificate#keyUsage as Node 26-shaped Extended Key Usage OID arrays
  • keeps absent extension properties returning undefined
  • adds an embedded extension-bearing certificate parity fixture

Scope

The implementation decodes the existing parsed X509 handle's extensions with RustCrypto x509-cert types and routes the two new properties through the handle property dispatcher.

This intentionally follows the Node 26 observed keyUsage shape for Extended Key Usage OIDs, not a broader Basic Key Usage flag surface.

Non-goals

Still intentionally outside this slice: checkHost() / checkEmail() / checkIP(), certificate/key verification, publicKey, issuerCertificate, infoAccess, and toLegacyObject().

Verification

  • npm exec --package=node@26 -- node test-parity/node-suite/crypto/x509/extension-metadata.ts
  • CARGO_TARGET_DIR=/tmp/perry-node-x509-check-target cargo check -p perry-stdlib --no-default-features --features crypto
  • CARGO_TARGET_DIR=/tmp/perry-node-x509-check-target npm exec --package=node@26 -- bash -lc './run_parity_tests.sh --suite node-suite --module crypto --filter extension-metadata'
  • PERRY_NO_AUTO_OPTIMIZE=1 CARGO_TARGET_DIR=/tmp/perry-node-x509-check-target npm exec --package=node@26 -- bash -lc './run_parity_tests.sh --suite node-suite --module crypto --filter x509'
  • cargo fmt --all -- --check
  • git diff --check
  • ./scripts/check_file_size.sh

@proggeramlug proggeramlug marked this pull request as ready for review June 3, 2026 11:52
@proggeramlug proggeramlug merged commit d4c208b into PerryTS:main Jun 3, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants