Class: SSLyze::OCSPResponse
- Inherits:
-
Object
- Object
- SSLyze::OCSPResponse
- Includes:
- Types
- Defined in:
- lib/sslyze/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 OCSP response.
-
#produced_at ⇒ Time
When the response was produced.
-
#responder_id ⇒ String
The responder ID.
-
#status ⇒ Symbol
The response status.
-
#successful? ⇒ Boolean
Determines whether the OCSP response was a success.
-
#trusted? ⇒ Boolean
Specifies whether the response was trusted.
-
#type ⇒ String
The response type.
-
#version ⇒ Integer
The OCSP version.
Constructor Details
#initialize(node) ⇒ OCSPResponse
Initializes the OCSP response.
19 20 21 |
# File 'lib/sslyze/ocsp_response.rb', line 19 def initialize(node) @node = node end |
Instance Method Details
#produced_at ⇒ Time
When the response was produced.
82 83 84 |
# File 'lib/sslyze/ocsp_response.rb', line 82 def produced_at @produced_at ||= Time.parse(@node.at('producedAt').inner_text) end |
#responder_id ⇒ String
The responder ID.
46 47 48 |
# File 'lib/sslyze/ocsp_response.rb', line 46 def responder_id @id ||= @node.at('responderID').inner_text end |
#status ⇒ Symbol
The response status.
64 65 66 |
# File 'lib/sslyze/ocsp_response.rb', line 64 def status @status ||= @node.at('responseStatus').inner_text.to_sym end |
#successful? ⇒ Boolean
Determines whether the OCSP response was a success.
73 74 75 |
# File 'lib/sslyze/ocsp_response.rb', line 73 def successful? status == :successful end |
#trusted? ⇒ Boolean
Specifies whether the response was trusted.
28 29 30 |
# File 'lib/sslyze/ocsp_response.rb', line 28 def trusted? Boolean[@node['isTrustedByMozillaCAStore']] end |
#type ⇒ String
The response type.
37 38 39 |
# File 'lib/sslyze/ocsp_response.rb', line 37 def type @type ||= @node.at('responseType').inner_text end |
#version ⇒ Integer
The OCSP version.
55 56 57 |
# File 'lib/sslyze/ocsp_response.rb', line 55 def version @version ||= @node.at('version').inner_text.to_i end |