-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crypto: KeyObject.asymmetricKeySize API #26387
Conversation
Expose the size of asymetric keys of crypto key object from the crypto module added in v11.6.0 (nodejs#24234)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM. CI: https://ci.nodejs.org/job/node-test-pull-request/21140/
Maybe a minor suggestion vis-a-vis the commit log summary: crypto: add KeyObject.asymmetricKeySize
?
The link to the issue should be Fixes: https://github.com/nodejs/node/pull/24234
on its own line.
edit: make that Refs: https://github.com/nodejs/node/pull/24234
Expose the size of asymetric keys of crypto key object from the crypto module added in v11.6.0. PR-URL: nodejs#26387 Refs: nodejs#24234 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Landed in 4895927 🎉 I updated the commit message while landing as suggested. |
Expose the size of asymetric keys of crypto key object from the crypto module added in v11.6.0. PR-URL: nodejs#26387 Refs: nodejs#24234 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
👋 Maybe i'm missing something but This is apparent with Ed25519 and Ed448 and possibly EC keys as well. pem =`-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAEXRYV3v5ucrHVR3mKqyPXxXqU34lASwc7Y7MoOvaqcs=\n-----END PUBLIC KEY-----`
k=crypto.createPublicKey(pem)
// PublicKeyObject { [Symbol(kKeyType)]: 'public' }
k.asymmetricKeyType
// 'ed25519'
k.asymmetricKeySize
// 114 114 bytes is the length of a signature, key is in fact 57 bytes |
@panva That's probably worth posting a new issue for. |
Will do, wanted to check first if i missed something |
created #26631 |
i only checked it with RSA, since there are only RSA tests for the |
I'm assuming this should have been marked as semver-minor. |
Notable Changes * build: * Enable v8's siphash for hash seed creation (Rod Vagg) #26367 * crypto: * Add `KeyObject.asymmetricKeySize` (Patrick Gansterer) #26387 * deps: * Upgrade openssl to 1.1.1b (Sam Roberts) #26327 * process: * Make `process[Symbol.toStringTag]` writable again (Ruben Bridgewater) #26488 * repl: * Add `util.inspect.replDefaults` to customize the writer (Ruben Bridgewater) #26375 * report: * Rename `triggerReport()` to `writeReport()` (Colin Ihrig) #26527
I'll back out this PR from v11.12.0 due to the concerns by @tniessen. If this should indeed land in a PR, please update the labels accordingly. |
Expose the size of asymetric keys of crypto key object from the
crypto module added in v11.6.0 (#24234)
Refs: #24234
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes