Class: SSLyze::XML::Certinfo::OCSPStapling::OCSPResponse

Inherits:
Object
  • Object
show all
Includes:
Types
Defined in:
lib/sslyze/xml/certinfo/ocsp_stapling/ocsp_response.rb

Overview

Represents the <ocspResponse> XML element.

Since:

  • 1.0.0

Constant Summary

Constants included from Types

Types::Boolean, Types::None

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ OCSPResponse

Parameters:

  • node (Nokogiri::XML::Element)

    The <ocspResponse> XML element.

Since:

  • 1.0.0



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.

Returns:

Since:

  • 1.0.0



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_atTime Also known as: to_time

When the response was produced at.

Returns:

  • (Time)

Since:

  • 1.0.0



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_idString Also known as: id

Note:

Parses the responderID attribute.

The responder's ID.

Returns:

  • (String)

Since:

  • 1.0.0



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.

Returns:

  • (:successful)

Since:

  • 1.0.0



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.

Returns:

Since:

  • 1.0.0



67
68
69
# File 'lib/sslyze/xml/certinfo/ocsp_stapling/ocsp_response.rb', line 67

def successful?
  status == :successful
end