class R509::Cert::Extensions::UserNotice

This class is used to help build the certificate policies extension

UserNotice ::= SEQUENCE {
     noticeRef        NoticeReference OPTIONAL,
     explicitText     DisplayText OPTIONAL }

Attributes

explicit_text[R]
notice_reference[R]

Public Class Methods

new(data) click to toggle source
# 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

Public Instance Methods

to_h() click to toggle source

@return [Hash]

# 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() click to toggle source

@return [YAML]

# File lib/r509/cert/extensions/certificate_policies.rb, line 221
def to_yaml
  self.to_h.to_yaml
end