Skip to content
forked from aptible/mini_ca

A Gem to generate custom X509 certificates in specs

License

Notifications You must be signed in to change notification settings

krallin/mini_ca

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Copyright and License

MIT License, see LICENSE for details.

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

About

A Gem to generate custom X509 certificates in specs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%