Add SshKey class for SSH key management#1
Merged
Conversation
Add programmatic SSH key management via a new SshKey class wrapping libssh's PKI API. Supports key generation (RSA, ED25519, ECDSA), import/export from files and strings with optional passphrase encryption, key inspection (type, fingerprint, public/private state), and comparison by public key material. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new Qore::Ssh::SshKey API layer around libssh PKI primitives to enable programmatic SSH key generation/import/export/inspection in the ssh module, along with typed metadata (SshKeyInfo), exported constants, documentation, and a dedicated test suite.
Changes:
- Introduces
SshKeyclass implementation and wires it into module initialization. - Adds
SshKeyInfotyped hash plus key-type/file-format/hash-type constants toQore::Ssh. - Adds new documentation page and a comprehensive
SshKeyQUnit test suite.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/QC_SshKey.qpp |
New SshKey class wrapping libssh PKI for key lifecycle operations. |
src/ssh.qpp |
Registers SshKeyInfo, constants, and initializes/exports the new system class. |
src/ssh-module.h |
Exposes new typed-hash and class IDs for the SshKey integration. |
test/SshKey.qtest |
New test coverage for generation, import/export roundtrips, inspection, comparison, and error handling. |
docs/ssh-key-management.doxygen.tmpl |
New end-user documentation page for the SshKey API. |
docs/typed-contracts.doxygen.tmpl |
Adds SshKeyInfo to the typed-hash index. |
docs/mainpage.doxygen.tmpl |
Links the new key-management docs and class reference from the main documentation page. |
CMakeLists.txt |
Includes the new source and documentation template in the build. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add null-pointer check after ssh_pki_export_privkey_to_pubkey() - Use enum constants for default parameter values instead of literals - Fix SshKeyInfo.fingerprint_sha256 doc: OpenSSH-style base64, not hex - Fix auth integration example to use single .pub file, not authorized_keys - Add up-front validation of bits parameter in generate() for ECDSA curve/bits mismatch and RSA minimum size Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SshKeyclass wrapping libssh's PKI API for programmatic SSH key managementSshKeyInfotyped hash, key type constants, file format constants, and hash type constantsTest plan
🤖 Generated with Claude Code