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)
-
- (Object) explicit_text
readonly
Returns the value of attribute explicit_text.
-
- (Object) notice_reference
readonly
Returns the value of attribute notice_reference.
Instance Method Summary (collapse)
-
- (UserNotice) initialize(data)
constructor
A new instance of UserNotice.
- - (Hash) to_h
- - (YAML) to_yaml
Constructor Details
- (UserNotice) initialize(data)
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.kind_of?(OpenSSL::ASN1::Sequence) @notice_reference = NoticeReference.new(qualifier) else @explicit_text = qualifier.value end end if data.respond_to?(:each) end |
Instance Attribute Details
- (Object) explicit_text (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 |
- (Object) notice_reference (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
- (Hash) to_h
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 |
- (YAML) to_yaml
221 222 223 |
# File 'lib/r509/cert/extensions/certificate_policies.rb', line 221 def to_yaml self.to_h.to_yaml end |