Class: R509::Cert::Extensions::CertificatePolicies

Inherits:
OpenSSL::X509::Extension
  • Object
show all
Defined in:
lib/r509/cert/extensions.rb

Overview

Implements the CertificatePolicies certificate extension, with methods to provide access to the components and meaning of the extension's contents.

Constant Summary

OID =

friendly name for CP OID

"certificatePolicies"

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (CertificatePolicies) initialize(*args)

A new instance of CertificatePolicies



516
517
518
519
520
521
522
523
524
525
526
527
# File 'lib/r509/cert/extensions.rb', line 516

def initialize(*args)
  @policies = []
  super(*args)

  data = R509::ASN1.get_extension_payload(self)

  # each element of this sequence should be part of a policy + qualifiers
  #   certificatePolicies ::= SEQUENCE SIZE (1..MAX) OF PolicyInformation
  data.each do |cp|
    @policies << R509::ASN1::PolicyInformation.new(cp)
  end if data.respond_to?(:each)
end

Instance Attribute Details

- (Object) policies (readonly)

Returns the value of attribute policies



514
515
516
# File 'lib/r509/cert/extensions.rb', line 514

def policies
  @policies
end