Class: CertValidator::CrlValidator
- Inherits:
-
Object
- Object
- CertValidator::CrlValidator
- Defined in:
- lib/cert_validator/crl/extractor.rb,
lib/cert_validator/crl_validator.rb
Defined Under Namespace
Classes: Extractor
Instance Attribute Summary collapse
-
#ca ⇒ Object
readonly
Returns the value of attribute ca.
-
#certificate ⇒ Object
readonly
Returns the value of attribute certificate.
- #crl ⇒ Object
-
#revoked_time ⇒ Object
readonly
Returns the value of attribute revoked_time.
Instance Method Summary collapse
- #available? ⇒ Boolean
-
#initialize(cert, ca) ⇒ CrlValidator
constructor
A new instance of CrlValidator.
- #valid? ⇒ Boolean
Constructor Details
#initialize(cert, ca) ⇒ CrlValidator
Returns a new instance of CrlValidator.
10 11 12 13 |
# File 'lib/cert_validator/crl_validator.rb', line 10 def initialize(cert, ca) @certificate = cert @ca = ca end |
Instance Attribute Details
#ca ⇒ Object (readonly)
Returns the value of attribute ca.
5 6 7 |
# File 'lib/cert_validator/crl_validator.rb', line 5 def ca @ca end |
#certificate ⇒ Object (readonly)
Returns the value of attribute certificate.
4 5 6 |
# File 'lib/cert_validator/crl_validator.rb', line 4 def certificate @certificate end |
#crl ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/cert_validator/crl_validator.rb', line 44 def crl return @crl if defined? @crl distribution_points = extractor.distribution_points distribution_points.first do |dp| @crl = fetch dp end end |
#revoked_time ⇒ Object (readonly)
Returns the value of attribute revoked_time.
8 9 10 |
# File 'lib/cert_validator/crl_validator.rb', line 8 def revoked_time @revoked_time end |
Instance Method Details
#available? ⇒ Boolean
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/cert_validator/crl_validator.rb', line 15 def available? return true if has_crl_data? return false unless extractor.has_distribution_points? begin return false unless vivified_crl rescue OpenSSL::X509::CRLError return false end return true end |
#valid? ⇒ Boolean
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/cert_validator/crl_validator.rb', line 28 def valid? return false unless available? begin return false unless vivified_crl rescue OpenSSL::X509::CRLError return false end return false unless matches_ca? return false if revoked? return true end |