0.01
No release in over 3 years
Low commit activity in last 3 years
Adds PKCS8 key format support to OpenSSL::PKey::RSA
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.6.4
 Project Readme

openssl-pkcs8

Obsolete

NOTE: This is no longer required as Ruby 3.x includes native PKCS8 support in the form of the private_to_pem method.

This adds PKCS8 compliant key export to the OpenSSL::PKey::RSA library that is part of standard Ruby distributions.

Example:

key = OpenSSL::PKey::RSA.new(1024)

key.to_pem_pkcs8
# => "-----BEGIN PRIVATE KEY----- ..."

This will export the private key in PKCS8 format, and will export public keys in the PUBKEY format used by OpenSSL. Note the absence of "RSA" in both of the headers.

Installation

Using the Gem distribution is probably easiest:

gem install openssl_pkcs8

Copyright

The contents of openssl_pkcs8.c is mostly taken from the Ruby distribution and is licensed under exactly the same terms as the original.

The remainder is (C) 2012 Scott Tadman under the MIT License.