Skip to content

doc: clarify PEM format for signing keys#64404

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
harjothkhara:codex/doc-crypto-pem-keys
Jul 15, 2026
Merged

doc: clarify PEM format for signing keys#64404
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
harjothkhara:codex/doc-crypto-pem-keys

Conversation

@harjothkhara

@harjothkhara harjothkhara commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Clarify that bare string and buffer-source keys passed to the signing and
verification APIs must contain PEM-encoded key material.

This documents the behavior consistently for:

  • Sign#sign()
  • Verify#verify()
  • crypto.sign()
  • crypto.verify()

Structured key objects can continue to select other supported formats through
their format property.

Fixes: #35331

Validation

  • node tools/lint-md/lint-md.mjs doc/api/crypto.md
  • make doc-only
  • Runtime probe covering string, ArrayBuffer, Buffer, TypedArray, and
    DataView PEM inputs, plus rejection of a bare DER input

Duplicate-work check

PR #63350 previously attempted similar wording for only crypto.sign() and
crypto.verify(), then was withdrawn without review. This change covers all
four APIs identified in the issue discussion.

Signed-off-by: harjoth <harjoth.khara@gmail.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto

@nodejs-github-bot nodejs-github-bot added crypto Issues and PRs related to the crypto subsystem. doc Issues and PRs related to the documentations. labels Jul 10, 2026
@harjothkhara harjothkhara marked this pull request as ready for review July 10, 2026 06:48
@pimterry pimterry added the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 14, 2026
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Jul 14, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator
Commit Queue failed
- Loading data for nodejs/node/pull/64404
✔  Done loading data for nodejs/node/pull/64404
----------------------------------- PR info ------------------------------------
Title      doc: clarify PEM format for signing keys (#64404)
Author     Harjoth Khara <harjoth.khara@gmail.com> (@harjothkhara, first-time contributor)
Branch     harjothkhara:codex/doc-crypto-pem-keys -> nodejs:main
Labels     crypto, doc
Commits    1
 - doc: clarify PEM format for signing keys
Committers 1
 - harjoth <harjoth.khara@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64404
Fixes: https://github.com/nodejs/node/issues/35331
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/64404
Fixes: https://github.com/nodejs/node/issues/35331
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Fri, 10 Jul 2026 06:43:39 GMT
   ✔  Approvals: 2
   ✔  - Tim Perry (@pimterry): https://github.com/nodejs/node/pull/64404#pullrequestreview-4670366516
   ✔  - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/64404#pullrequestreview-4674166183
   ✘  2 GitHub CI job(s) cancelled:
   ✘    - lint-pr-url: CANCELLED (https://github.com/nodejs/node/actions/runs/29074607456/job/86334929473)
   ✘    - lint-readme: CANCELLED (https://github.com/nodejs/node/actions/runs/29074607456/job/86334929515)
   ℹ  Green GitHub CI is sufficient
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/29363329109

@pimterry pimterry added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Jul 15, 2026
@pimterry

Copy link
Copy Markdown
Member

Commit queue issue here is unrelated - it seems that switching draft to ready-to-review immediately after opening the PR confused some job statuses, I think I've cleaned it up so it'll work this time.

@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 15, 2026
@nodejs-github-bot nodejs-github-bot merged commit 5d68eb4 into nodejs:main Jul 15, 2026
89 of 95 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 5d68eb4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

crypto Issues and PRs related to the crypto subsystem. doc Issues and PRs related to the documentations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doc: crypto.sign and crypto.verify string/buffer keys must be pem

4 participants