Repository is archived
No commit activity in last 3 years
No release in over 3 years
This library patches OpenSSL to add helper methods and extensions to OpenSSL objects with the intention of making the interface more intuitive.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.4
 Project Readme

OpenSSL Extensions

Gem Version Build Status Code Climate

This library generally provides helper methods which makes working with OpenSSL a little more bearable. It does, however, provide some additional structures (such as a CertificateChain) which extend the traditional features of the library.

Installation

With Bundler:

gem 'openssl-extensions', :require => 'openssl-extensions/all'

With standard RubyGems:

gem install openssl-extensions
require 'rubygems'
require 'openssl-extensions/all'

Once required, the extensions are automatically applied.

Usage

In general, this extension library should be somewhat transparent to you. It does not directly provide many classes with which you might interact. Instead, it extends the current classes provided by Ruby's OpenSSL library (being OpenSSL::X509::Request, OpenSSL::X509::Certificate, and OpenSSL::X509::NAME).

Below is a simple example exercising a few helpers provided by this library:

csr_body = File.read('example.csr') # assuming this is valid and exists
request = OpenSSL::X509::Request.new(csr_body)
    
request.subject.common_name         # => "example.com"
request.subject.organization        # => "Example Corp"
request.subject.locality            # => "Orlando"
request.subject.region              # => "Florida"
request.subject.country             # => "US"
request.subject.location            # => "Orlando, Florida, US"
    
request.strength                    # => 2048
request.challenge_password?         # => false
request.subject_alternative_names   # => ['example.com', 'www.example.com']

Supported Ruby Implementations

This OpenSSL extension library currently supports (and is continuously tested against) the following Ruby implementations:

The following implementations are known to be incompatible:

License

Released under the MIT License. See the LICENSE file for further details.