Class: SSLyze::Certificate::Subject
- Inherits:
-
Object
- Object
- SSLyze::Certificate::Subject
- Defined in:
- lib/sslyze/certificate/subject.rb
Overview
Represents the <subject> XML element.
Instance Method Summary collapse
-
#business_category ⇒ String
Business category.
-
#common_name ⇒ DomainName
Common name.
-
#country_name ⇒ String
Country name.
-
#initialize(node) ⇒ Subject
constructor
Initializes the subject.
-
#locality_name ⇒ String
Locality name.
-
#organization_name ⇒ String
Organization name.
-
#organizational_unit_name ⇒ String
Organizational unit name.
-
#postal_code ⇒ String
Postal code.
-
#serial_number ⇒ Integer
Serial number.
-
#state_or_province_name ⇒ String
State/province name.
-
#street_address ⇒ String
Street address.
Constructor Details
#initialize(node) ⇒ Subject
Initializes the subject.
16 17 18 |
# File 'lib/sslyze/certificate/subject.rb', line 16 def initialize(node) @node = node end |
Instance Method Details
#business_category ⇒ String
Business category.
43 44 45 |
# File 'lib/sslyze/certificate/subject.rb', line 43 def business_category @business_category ||= @node.at('businessCategory').inner_text end |
#common_name ⇒ DomainName
Common name.
61 62 63 64 65 |
# File 'lib/sslyze/certificate/subject.rb', line 61 def common_name @common_name ||= if (common_name = @node.at('commonName')) DomainName.new(common_name.inner_text) end end |
#country_name ⇒ String
Country name.
81 82 83 |
# File 'lib/sslyze/certificate/subject.rb', line 81 def country_name @country_name ||= @node.at('countryName').inner_text end |
#locality_name ⇒ String
Locality name.
102 103 104 |
# File 'lib/sslyze/certificate/subject.rb', line 102 def locality_name @locality_name ||= @node.at('localityName').inner_text end |
#organization_name ⇒ String
Organization name.
34 35 36 |
# File 'lib/sslyze/certificate/subject.rb', line 34 def organization_name @organization_name ||= @node.at('organizationName').inner_text end |
#organizational_unit_name ⇒ String
Organizational unit name.
25 26 27 |
# File 'lib/sslyze/certificate/subject.rb', line 25 def organizational_unit_name @organizational_unit_name ||= @node.at('organizationalUnitName').inner_text end |
#postal_code ⇒ String
Postal code.
111 112 113 |
# File 'lib/sslyze/certificate/subject.rb', line 111 def postal_code @postal_code ||= @node.at('postalCode').inner_text end |
#serial_number ⇒ Integer
Serial number.
52 53 54 |
# File 'lib/sslyze/certificate/subject.rb', line 52 def serial_number @serial_number ||= @node.at('serialNumber').inner_text.to_i end |
#state_or_province_name ⇒ String
State/province name.
72 73 74 |
# File 'lib/sslyze/certificate/subject.rb', line 72 def state_or_province_name @state_or_province_name ||= @node.at('stateOrProvinceName').inner_text end |
#street_address ⇒ String
Street address.
90 91 92 |
# File 'lib/sslyze/certificate/subject.rb', line 90 def street_address @street_address ||= @node.at('streetAddress').inner_text end |