Method: OpenSSL::X509::Name::RFC2253DN.expand_pair

Defined in:
lib/openssl/x509.rb

.expand_pair(str) ⇒ Object



79
80
81
82
83
84
85
86
87
88
89
# File 'lib/openssl/x509.rb', line 79

def expand_pair(str)
  return nil unless str
  return str.gsub(Pair){
    pair = $&
    case pair.size
    when 2 then pair[1,1]
    when 3 then Integer("0x#{pair[1,2]}").chr
    else raise OpenSSL::X509::NameError, "invalid pair: #{str}"
    end
  }
end