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'
152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/puppet/ssl/oids.rb', line 152 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 |