Project

mini_ca

0.0
No release in over 3 years
Low commit activity in last 3 years
A minimal Certification Authority, for use in specs
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

MiniCa

Gem Version Dependency Status

A Gem to generate custom X509 certificates in specs.

Installation

Add the following line to your application's Gemfile.

gem 'mini_ca'

And then run bundle install.

Usage

# Instantiate a CA
ca = MiniCa::Certificate.new('My Test CA', ca: true)

# Create an intermediate
intermediate = ca.issue('My Intermediate', ca: true)

# Create a certificate
certificate = intermediate.issue('My Certificate')

# Get the certificate chain as PEM
certificate.chain_pem

# Get the certificate bundle (i.e. including the leaf certificate) as PEM
certificate.bundle_pem

# Verify a certificate
ca.store.verify(certificate.x509, [intermediate.x509])

See the specs for more examples.

Contributing

  1. Fork the project.
  2. Commit your changes, with specs.
  3. Ensure that your code passes specs (rake spec) and meets Aptible's Ruby style guide (rake rubocop).
  4. Create a new pull request on GitHub.

Copyright and License

MIT License, see LICENSE for details.

Copyright (c) 2019 Aptible, Thomas Orozco, and contributors.