Methods
- G
- I
- M
- N
- S
- V
Included Modules
Constants
| CERT_TYPE_SELF_SIGNED | = | 0 |
| CERT_TYPE_OTHER | = | 1 |
| CERT_TYPE_EE | = | 2 |
Attributes
| [R] | crl | |
| [R] | ee | |
| [R] | other_ca | |
| [R] | request | |
| [R] | self_signed_ca |
Class Public methods
new(certs_dir)
Link
Source: show
# File sample/openssl/certstore.rb, line 15 def initialize(certs_dir) @certs_dir = certs_dir @c_store = CHashDir.new(@certs_dir) @c_store.hash_dir(true) @crl_store = CrlStore.new(@c_store) @x509store = Store.new @self_signed_ca = @other_ca = @ee = @crl = nil # Uncomment this line to let OpenSSL to check CRL for each certs. # @x509store.flags = V_FLAG_CRL_CHECK | V_FLAG_CRL_CHECK_ALL add_path scan_certs end
Instance Public methods
generate_cert(filename)
Link
Source: show
# File sample/openssl/certstore.rb, line 30 def generate_cert(filename) @c_store.load_pem_file(filename) end
is_ca?(cert)
Link
Source: show
# File sample/openssl/certstore.rb, line 47 def is_ca?(cert) case guess_cert_type(cert) when CERT_TYPE_SELF_SIGNED true when CERT_TYPE_OTHER true else false end end
match_cert(cert1, cert2)
Link
Source: show
# File sample/openssl/certstore.rb, line 43 def match_cert(cert1, cert2) (cert1.issuer.cmp(cert2.issuer) == 0) and cert1.serial == cert2.serial end