MiniCa

Gem Version Build Status 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.

MIT License, see LICENSE for details.

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