Class: R509::Cert::Extensions::InhibitAnyPolicy

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

Overview

The inhibit anyPolicy extension indicates that the special anyPolicy OID, with the value { 2 5 29 32 0 }, is not considered an explicit match for other certificate policies except when it appears in an intermediate self-issued CA certificate. The value indicates the number of additional non-self-issued certificates that may appear in the path before anyPolicy is no longer permitted. For example, a value of one indicates that anyPolicy may be processed in certificates issued by the subject of this certificate, but not in additional certificates in the path.

You can use this extension to parse an existing extension for easy access to the contents or create a new one.

Constant Summary

OID =

friendly name for CP OID

"inhibitAnyPolicy"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arg) ⇒ InhibitAnyPolicy

This method takes a hash or an existing Extension object to parse

Parameters:

  • arg (Hash)

    a customizable set of options

Options Hash (arg):

  • :value (Integer)
  • :critical (Boolean) — default: true


33
34
35
36
37
38
39
40
# File 'lib/r509/cert/extensions/inhibit_any_policy.rb', line 33

def initialize(arg)
  unless R509::Cert::Extensions.is_extension?(arg)
    arg = build_extension(arg)
  end

  super(arg)
  parse_extension
end

Instance Attribute Details

#valueInteger (readonly)

Returns:

  • (Integer)


27
28
29
# File 'lib/r509/cert/extensions/inhibit_any_policy.rb', line 27

def value
  @value
end

Instance Method Details

#to_hHash

Returns:

  • (Hash)


43
44
45
# File 'lib/r509/cert/extensions/inhibit_any_policy.rb', line 43

def to_h
  { :critical => self.critical?, :value => @value }
end

#to_yamlYAML

Returns:

  • (YAML)


48
49
50
# File 'lib/r509/cert/extensions/inhibit_any_policy.rb', line 48

def to_yaml
  self.to_h.to_yaml
end