A small client for the Tinycert.org api
Add this line to your application's Gemfile:
gem 'tinycert'
And then execute:
$ bundle
Or install it yourself as:
$ gem install tinycert
require 'tinycert'
tinycert = TinyCert::Client.new '<your@email.address>', '<your passphrase>', '<your api key>'
Note, your API key can be found in the API documentation
Your passphrase is not the same as your password. You should have your passphrase stored in your browser or securely elsewhere. You can set your password on the Tinycert profile page
This will also call disconnect after the block
t = TinyCert::Client.new '<your@email.address>', '<your passphrase>', '<your api key>'
t.connect do |t|
a = t.authorities[5358]
cert = a.certs.create 'example.com', names: ['www.example.com', '*.example.com'], o: 'Development'
end
cas = tinycert.authorities.list
ca = tinycert.authorities[1111]
=> #<Tinycert::CertAuthority:0x007f83423cd710 @id=1111, @name="Ideas Asylum">
ca.certs.create 'example.com', names: ['example.com', 'www.example.com', '*.example.com']
certs = ca.certs.good
[#<Tinycert::Cert:0x007f97d84043c8 @id=11111, @status="good", @cn=nil, @names=[]>]
certs.first.details
=> #<Tinycert::Cert:0x007ff34bb0fce8 @id=14236, @status="good", @cn="lvh.me", @names=["lvh.me", "*.lvh.me"]>
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/ideasasylum/tinycert.
The gem is available as open source under the terms of the MIT License.