Method: Puppet::SSL::Oids.load_custom_oid_file

Defined in:
lib/puppet/ssl/oids.rb

.load_custom_oid_file(custom_oid_file, map_key = 'oid_mapping') ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Load custom OID mapping file that enables custom OIDs to be resolved into user-friendly names.


oid_mapping:

'1.3.6.1.4.1.34380.1.2.1.1':
  shortname : 'myshortname'
  longname  : 'Long name'
'1.3.6.1.4.1.34380.1.2.1.2':
  shortname: 'myothershortname'
  longname: 'Other Long name'

Examples:

Custom OID mapping file

Parameters:

  • custom_oid_file (String)

    File to obtain custom OIDs mapping from

  • map_key (String) (defaults to: 'oid_mapping')

    Hash key in which custom OIDs mapping is stored



142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/puppet/ssl/oids.rb', line 142

def self.load_custom_oid_file(custom_oid_file, map_key='oid_mapping')
  oid_defns = parse_custom_oid_file(custom_oid_file, map_key)
  unless oid_defns.nil?
    begin
      oid_defns.each do |oid_defn|
        OpenSSL::ASN1::ObjectId.register(*oid_defn)
      end
    rescue => err
      raise ArgumentError, _("Error registering ssl custom OIDs mapping from file '%{custom_oid_file}': %{err}") % { custom_oid_file: custom_oid_file, err: err }, err.backtrace
    end
  end
end