Class: R509::Cert::Extensions::UserNotice
- Inherits:
-
Object
- Object
- R509::Cert::Extensions::UserNotice
- Defined in:
- lib/r509/cert/extensions/certificate_policies.rb
Overview
This class is used to help build the certificate policies extension
UserNotice ::= SEQUENCE {
noticeRef NoticeReference OPTIONAL,
explicitText DisplayText OPTIONAL }
Instance Attribute Summary collapse
-
#explicit_text ⇒ Object
readonly
Returns the value of attribute explicit_text.
-
#notice_reference ⇒ Object
readonly
Returns the value of attribute notice_reference.
Instance Method Summary collapse
-
#initialize(data) ⇒ UserNotice
constructor
A new instance of UserNotice.
- #to_h ⇒ Hash
- #to_yaml ⇒ YAML
Constructor Details
#initialize(data) ⇒ UserNotice
Returns a new instance of UserNotice
200 201 202 203 204 205 206 207 208 209 210 |
# File 'lib/r509/cert/extensions/certificate_policies.rb', line 200 def initialize(data) data.each do |qualifier| # if we find another sequence, that's a noticeReference, otherwise it's explicitText if qualifier.is_a?(OpenSSL::ASN1::Sequence) @notice_reference = NoticeReference.new(qualifier) else @explicit_text = qualifier.value end end if data.respond_to?(:each) end |
Instance Attribute Details
#explicit_text ⇒ Object (readonly)
Returns the value of attribute explicit_text
199 200 201 |
# File 'lib/r509/cert/extensions/certificate_policies.rb', line 199 def explicit_text @explicit_text end |
#notice_reference ⇒ Object (readonly)
Returns the value of attribute notice_reference
199 200 201 |
# File 'lib/r509/cert/extensions/certificate_policies.rb', line 199 def notice_reference @notice_reference end |
Instance Method Details
#to_h ⇒ Hash
213 214 215 216 217 218 |
# File 'lib/r509/cert/extensions/certificate_policies.rb', line 213 def to_h hash = {} hash[:explicit_text] = @explicit_text unless @explicit_text.nil? hash.merge!(@notice_reference.to_h) unless @notice_reference.nil? hash end |
#to_yaml ⇒ YAML
221 222 223 |
# File 'lib/r509/cert/extensions/certificate_policies.rb', line 221 def to_yaml self.to_h.to_yaml end |