Skip to content
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

fix(ext/node): implement asymmetric keygen #18651

Merged
merged 18 commits into from
Apr 19, 2023

Conversation

littledivy
Copy link
Member

@littledivy littledivy commented Apr 10, 2023

Towards #18455

This commit implements the keypair generation for asymmetric keys for the generateKeyPair API.

See how key material is managed in this implementation: https://www.notion.so/denolandinc/node-crypto-design-99fc33f568d24e47a5e4b36002c5325d?pvs=4

Private and public key encoding depend on KeyObject#export which is not implemented. I've also skipped ED448 and X448 since we need a crate for that in WebCrypto too.

@littledivy littledivy marked this pull request as ready for review April 15, 2023 05:44
@littledivy littledivy changed the title [wip] feat(ext/node): implement asymmetric keygen fix(ext/node): implement asymmetric keygen Apr 15, 2023
Comment on lines -3298 to +3331
"der",
"pkcs8",
"spki",
"der 0.6.1",
"pkcs8 0.9.0",
"spki 0.6.0",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uh oh. hold up

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to upgrade all the RustCrypto deps. I'll do it after this lands.

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation wise it looks great - I assume the native Node.js tests still can't be enabled due to other missing APIs. I'm worried about so many duplicate versions of dependencies being used though.

@littledivy littledivy merged commit 9496dfc into denoland:main Apr 19, 2023
bartlomieju pushed a commit to bartlomieju/deno that referenced this pull request Apr 20, 2023
Towards denoland#18455 

This commit implements the keypair generation for asymmetric keys for
the `generateKeyPair` API.

See how key material is managed in this implementation:
https://www.notion.so/denolandinc/node-crypto-design-99fc33f568d24e47a5e4b36002c5325d?pvs=4

Private and public key encoding depend on `KeyObject#export` which is
not implemented. I've also skipped ED448 and X448 since we need a crate
for that in WebCrypto too.
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