| Oct | NOV | Dec |
| 28 | ||
| 2019 | 2020 | 2021 |
COLLECTED BY
Collection: github.com
gem install ssh_data
require "ssh_data" key_data = File.read("~/.ssh/id_rsa.pub") key = SSHData::PublicKey.parse_openssh(key_data) #=> <SSHData::PublicKey::RSA> cert_data = = File.read("~/.ssh/id_rsa-cert.pub") cert = SSHData::Certificate.parse_openssh(cert_data) #=> <SSHData::PublicKey::Certificate> cert.key_id #=> "mastahyeti" cert.public_key #=> <SSHData::PublicKey::RSA>
ed25519 Gem. This library can parse ED25519 public and private keys itself, but in order to generate keys or sign or verify messages, the calling application must load the ed25519 Gem itself. This avoids the necessity of installing or loading this third party dependency when the calling application is only interested in parsing keys.
require "ssh_data" key_data = File.read("~/.ssh/id_ed25519") key = SSHData::PrivateKey.parse_openssh(key_data) #=> <SSHData::PrivateKey::ED25519> SSHData::PrivateKey::ED25519.generate #=> raises SSHData::AlgorithmError require "ed25519" SSHData::PrivateKey::ED25519.generate #=> <SSHData::PrivateKey::ED25519>