Ruby library for parsing SSH public keys and certificates
Перейти к файлу
Ben Toews cfc5029bfb
re-encode certificates back into openssh format
2019-02-21 16:27:00 -07:00
lib re-encode certificates back into openssh format 2019-02-21 16:27:00 -07:00
spec re-encode certificates back into openssh format 2019-02-21 16:27:00 -07:00
.gitignore add gitignore 2019-01-23 14:02:56 -07:00
Gemfile first commit 2019-01-17 10:47:31 -07:00
Gemfile.lock bump version 2019-01-31 08:43:20 -07:00
LICENSE.md change ownership 2019-01-25 09:06:18 -07:00
README.md rename PublicKey and Certificate `parse` methods `parse_openssh` 2019-02-11 12:06:20 -07:00
ssh_data.gemspec change ownership 2019-01-25 09:06:18 -07:00

README.md

ssh_data

This is a Ruby library for parsing SSH public keys and certificates.

Installation

gem install ssh_data

Usage

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>