Skip to content

A Gem to generate custom X509 certificates in specs

License

Notifications You must be signed in to change notification settings

aptible/mini_ca

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A Gem to generate custom X509 certificates in specs

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages