A pure Ruby library for generating, parsing, and validating SSH key pairs (RSA, DSA, ECDSA).
SSHKey is a Ruby library for programmatically generating and managing SSH key pairs. It provides a pure-Ruby implementation for creating RSA, DSA, and ECDSA keys, parsing existing keys, generating fingerprints, and validating public key formats. It solves the problem of needing to shell out to command-line tools like `ssh-keygen` for SSH key operations within Ruby applications.
Ruby developers building automation tools, DevOps scripts, or applications that require dynamic SSH key management, such as infrastructure provisioning, user onboarding systems, or secure server configuration.
Developers choose SSHKey for its self-contained, dependency-free approach to SSH key generation and inspection. It offers a more intuitive and programmable interface compared to executing external commands, making it easier to integrate SSH key operations into Ruby workflows with full control over key parameters and formats.
SSH private and public key generator in pure Ruby (RSA & DSA)
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Eliminates dependencies on external system commands like `ssh-keygen`, making it self-contained and ideal for automation scripts where shell calls are undesirable.
Supports generation, parsing, conversion, fingerprinting, and adding OpenSSH-style directives through a unified API, as shown with methods for RSA, DSA, and ECDSA keys.
Provides an intuitive interface where keys are objects with accessors for comments, passphrases, and directives, mirroring the conceptual model of SSH keys.
Includes methods like `valid_ssh_public_key?` and `ssh_public_key_bits` for validating user input and extracting key metadata, useful for secure applications.
Only supports RSA, DSA, and ECDSA key types, omitting the modern Ed25519 algorithm which is increasingly preferred for its security and performance.
Requires conversion of existing OpenSSH-format private keys to PEM, as admitted in the README, adding an extra step and potential user friction.
Tied exclusively to the Ruby ecosystem, making it unsuitable for projects in other languages or those requiring cross-platform key management libraries.