Skip to content

crypto: expose X509Certificate signature hash algorithm - #67797

Draft
bobnil wants to merge 1 commit into
nodejs:mainfrom
bobnil:crypto/x509-signature-hash-algorithm
Draft

bobnil wants to merge 1 commit into
nodejs:mainfrom
bobnil:crypto/x509-signature-hash-algorithm

Conversation

@bobnil

@bobnil bobnil commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Add a read-only signatureHashAlgorithm property to X509Certificate using OpenSSL's X509_get_signature_info().

This provides access to the digest algorithm used by parameterized signature schemes such as RSASSA-PSS, where the signature algorithm OID alone is insufficient to identify the digest.

This enables implementations of tls-server-end-point channel binding (RFC 5929), as used by SCRAM-PLUS authentication, without requiring additional ASN.1 parsing.

Include regression tests and API documentation.

The implementation has been built and tested locally against 53 different X.509 certificates, including 14 RSASSA-PSS variants. The resulting channel binding hashes match the reference values calculated using OpenSSL for all applicable certificates.

This PR is intended as a proof of concept demonstrating the feasibility of exposing this information. The proposed API, naming, return semantics, and implementation details are open for discussion with the Node.js maintainers.

Refs: #67794

Add a read-only signatureHashAlgorithm property to X509Certificate
using OpenSSL's X509_get_signature_info().

This provides access to the digest algorithm used by parameterized
signature schemes such as RSASSA-PSS, where the signature algorithm
OID alone is insufficient to identify the digest.

This enables implementations of tls-server-end-point channel binding
(RFC 5929), as used by SCRAM-PLUS authentication, without requiring
additional ASN.1 parsing.

Include regression tests and API documentation.

Signed-off-by: Robert I Nilsson <robert.i.nilsson@callclue.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/security-wg

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. dependencies PRs that add, update, or configure Node.js dependencies. needs-ci PRs that need a full CI run. labels Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. dependencies PRs that add, update, or configure Node.js dependencies. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants