Giter Club home page Giter Club logo

ssh_data's Introduction

ssh_data docs

This is a Ruby library for processing SSH keys and certificates.

The scope of this project is limited to processing and directly using keys and certificates. It can be used to generate SSH private keys, verify signatures using public keys, sign data using private keys, issue certificates using private keys, and parse certificates and public and private keys. This library supports RSA, DSA, ECDSA, and ED25519* keys. This library does not offer or intend to offer functionality for SSH connectivity, processing of SSH wire protocol data, or processing of other key formats or types.

Project Status: Used by @github in production

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>

ED25519 support

Ruby's standard library does not include support for ED25519, though the algorithm is implemented by the 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>

Contributions

This project is not currently seeking contributions for new features or functionality, though bug fixes are welcome. See CONTRIBUTING.md for more information.

License

This project is published under the MIT license. See LICENSE.md for mor information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.