Class: SSLyze::XML::Certinfo::OCSPStapling::OCSPResponse
- Inherits:
-
Object
- Object
- SSLyze::XML::Certinfo::OCSPStapling::OCSPResponse
- Includes:
- Types
- Defined in:
- lib/sslyze/xml/certinfo/ocsp_stapling/ocsp_response.rb
Overview
Represents the <ocspResponse>
XML element.
Constant Summary
Constants included from Types
Instance Method Summary collapse
-
#initialize(node) ⇒ OCSPResponse
constructor
Initializes the OCSPResponse object.
-
#is_trusted_by_mozilla_ca_store? ⇒ Boolean
(also: #trusted?)
Specifies whether the OCSP Response is trusted by Mozilla's CA Store.
-
#produced_at ⇒ Time
(also: #to_time)
When the response was produced at.
-
#responder_id ⇒ String
(also: #id)
The responder's ID.
-
#status ⇒ :successful
The status.
-
#successful? ⇒ Boolean
Determines if the response status was successful.
Constructor Details
#initialize(node) ⇒ OCSPResponse
Initializes the SSLyze::XML::Certinfo::OCSPStapling::OCSPResponse object.
25 26 27 |
# File 'lib/sslyze/xml/certinfo/ocsp_stapling/ocsp_response.rb', line 25 def initialize(node) @node = node end |
Instance Method Details
#is_trusted_by_mozilla_ca_store? ⇒ Boolean Also known as: trusted?
Specifies whether the OCSP Response is trusted by Mozilla's CA Store.
77 78 79 |
# File 'lib/sslyze/xml/certinfo/ocsp_stapling/ocsp_response.rb', line 77 def is_trusted_by_mozilla_ca_store? Boolean[@node['isTrustedByMozillaCAStore']] end |
#produced_at ⇒ Time Also known as: to_time
When the response was produced at.
47 48 49 |
# File 'lib/sslyze/xml/certinfo/ocsp_stapling/ocsp_response.rb', line 47 def produced_at @produced_at ||= Time.parse(@node.at_xpath('producedAt').inner_text) end |
#responder_id ⇒ String Also known as: id
Note:
Parses the responderID
attribute.
The responder's ID.
36 37 38 |
# File 'lib/sslyze/xml/certinfo/ocsp_stapling/ocsp_response.rb', line 36 def responder_id @responder_id ||= @node.at_xpath('responderID').inner_text end |
#status ⇒ :successful
The status.
58 59 60 |
# File 'lib/sslyze/xml/certinfo/ocsp_stapling/ocsp_response.rb', line 58 def status @status ||= @node['status'].downcase.to_sym end |
#successful? ⇒ Boolean
Determines if the response status was successful.
67 68 69 |
# File 'lib/sslyze/xml/certinfo/ocsp_stapling/ocsp_response.rb', line 67 def successful? status == :successful end |