Conversation
dknopik
left a comment
There was a problem hiding this comment.
Looks good!
What do you think about changing the client to implicitly invoke this if it finds no key? Replacing its current key gen mechanism.
dknopik
left a comment
There was a problem hiding this comment.
Nice, thanks! Just a nitpick:
|
Looks good! Another thing that came to my mind is zeroing the memory after use with |
|
Update: Need the ability to be able to force overwrites in ssv-mini so added cli flag to accomplish this |
|
We are writing passwords out in plaintext right now, which kinda defeats the purpose of zeroing out the memory. Adding an issue to enable password protection for the private key file. |
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new CLI tool for RSA key generation to support anchor nodes and the SSV UI webapp by generating a PEM file and a JSON file with base64 encoded keys.
- Added a new Cargo package (keygen) with dependencies for key generation.
- Implemented the key generation functionality in keygen’s library and integrated it into the existing anchor and client command flows.
- Updated related Cargo.toml files and a keysplit utility to support the new keygen module.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| anchor/keygen/Cargo.toml | Added package metadata and dependencies for the RSA keygen tool. |
| anchor/keygen/src/lib.rs | Implemented RSA key generation with PEM and JSON output functionality. |
| Cargo.toml | Added keygen to workspace members and dependencies. |
| anchor/src/main.rs | Integrated the keygen subcommand into the main command interface. |
| anchor/client/src/lib.rs | Replaced manual key generation with a call to the new run_keygen API. |
| anchor/keysplit/src/util.rs | Updated error handling for UTF-8 conversion in key serialization. |
| anchor/Cargo.toml | Added workspace configuration for the keygen package. |
| anchor/client/Cargo.toml | Added workspace configuration for the keygen dependency. |
jking-aus
left a comment
There was a problem hiding this comment.
nice -- just left a few todo comments so we remember to encrypt
Issue Addressed
#154
Proposed Changes
This pr introduces a new cli tool to generate rsa keys. It will generate a
key.pemfile to be used with the anchor nodes and akeys.jsonfile that contains the base64 encoded keys to be used with the ssv ui webapp.Note: this replaces the base64 headers in the key so that we can interop with the ssv-client for ssv-mini