https://github.com/fshin1988/ssl_certificate
Wrapper of OpenSSL::X509::Certificate
https://github.com/fshin1988/ssl_certificate
gem openssl ruby ssl-certificate
Last synced: 9 months ago
JSON representation
Wrapper of OpenSSL::X509::Certificate
- Host: GitHub
- URL: https://github.com/fshin1988/ssl_certificate
- Owner: fshin1988
- License: mit
- Created: 2017-09-05T14:01:49.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-10T08:17:14.000Z (almost 9 years ago)
- Last Synced: 2025-10-07T10:09:10.863Z (9 months ago)
- Topics: gem, openssl, ruby, ssl-certificate
- Language: Ruby
- Size: 19.5 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# SslCertificate
ssl_certificate is wrapper of OpenSSL::X509::Certificate.
It has some useful methods to handle ssl certificate.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'ssl_certificate'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install ssl_certificate
## Usage
```ruby
require 'ssl_certificate'
# create object from certificate of pem or der format
cert_pem = File.read("spec/test_data/www.example.com.crt")
cert = SslCertificate::Certificate.new(cert_pem)
cert.common_name
# => "www.example.com"
cert.alternative_names
# => ["example.com", "hoge.example.com"]
key_pem = File.read("spec/test_data/www.example.com.key")
cert.check_private_key_str(key_pem)
# => true
# check whether a fqdn corresponds to the certificate
cert.check_fqdn("www.example.com")
# => true
cert.check_fqdn("hoge.example.com")
# => true
```
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/fshin1988/ssl_certificate.
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).