Module: R509::OIDMapper
- Defined in:
- lib/r509/oid_mapper.rb
Overview
Helps map raw OIDs to friendlier short names
Class Method Summary collapse
-
.batch_register(oids) ⇒ Object
Register a batch of OIDs so we have friendly short names ].
-
.register(oid, short_name, long_name = nil) ⇒ Boolean
Register an OID so we have a friendly short name.
-
.register_from_yaml(name, yaml_data) ⇒ Object
Load YAML and register OIDs.
Class Method Details
.batch_register(oids) ⇒ Object
Register a batch of OIDs so we have friendly short names ]
25 26 27 28 29 30 |
# File 'lib/r509/oid_mapper.rb', line 25 def self.batch_register(oids) oids.each do |oid_hash| self.register(oid_hash[:oid], oid_hash[:short_name], oid_hash[:long_name]) end nil end |
.register(oid, short_name, long_name = nil) ⇒ Boolean
Register an OID so we have a friendly short name
11 12 13 14 15 16 |
# File 'lib/r509/oid_mapper.rb', line 11 def self.register(oid, short_name, long_name = nil) if long_name.nil? long_name = short_name end OpenSSL::ASN1::ObjectId.register(oid, short_name, long_name) end |
.register_from_yaml(name, yaml_data) ⇒ Object
Load YAML and register OIDs
41 42 43 44 |
# File 'lib/r509/oid_mapper.rb', line 41 def self.register_from_yaml(name, yaml_data) conf = YAML.load(yaml_data) self.batch_register(conf[name]) end |