Module: OpenSSL::X509::Name::RFC2253DN
Relationships & Source Files | |
Defined in: | ext/openssl/lib/openssl/x509.rb |
Constant Summary
-
AttributeType =
# File 'ext/openssl/lib/openssl/x509.rb', line 69/[a-zA-Z][0-9a-zA-Z]*|[0-9](?:\.[0-9])*/
-
AttributeValue =
# File 'ext/openssl/lib/openssl/x509.rb', line 70/ (?!["#])((?:#{StringChar}|#{Pair})*)| \#(#{HexString})| "((?:#{QuoteChar}|#{Pair})*)" /x
-
HexChar =
# File 'ext/openssl/lib/openssl/x509.rb', line 63/[0-9a-fA-F]/
-
HexPair =
# File 'ext/openssl/lib/openssl/x509.rb', line 64/#{HexChar}#{HexChar}/
-
HexString =
# File 'ext/openssl/lib/openssl/x509.rb', line 65/#{HexPair}+/
-
Pair =
# File 'ext/openssl/lib/openssl/x509.rb', line 66/\\(?:[#{Special}]|\\|"|#{HexPair})/
-
QuoteChar =
# File 'ext/openssl/lib/openssl/x509.rb', line 68/[^\\"]/
-
Special =
# File 'ext/openssl/lib/openssl/x509.rb', line 62',=+<>#;'
-
StringChar =
# File 'ext/openssl/lib/openssl/x509.rb', line 67/[^\\"#{Special}]/
-
TypeAndValue =
# File 'ext/openssl/lib/openssl/x509.rb', line 75/\A(#{AttributeType})=#{AttributeValue}/
Class Method Summary
- .expand_hexstring(str) mod_func
- .expand_pair(str) mod_func
- .expand_value(str1, str2, str3) mod_func
- .scan(dn) mod_func
Class Method Details
.expand_hexstring(str) (mod_func)
[ GitHub ].expand_pair(str) (mod_func)
[ GitHub ].expand_value(str1, str2, str3) (mod_func)
[ GitHub ]# File 'ext/openssl/lib/openssl/x509.rb', line 98
def (str1, str2, str3) value = (str1) value, tag = (str2) unless value value = (str3) unless value return value, tag end
.scan(dn) (mod_func)
[ GitHub ]# File 'ext/openssl/lib/openssl/x509.rb', line 105
def scan(dn) str = dn ary = [] while true if md = TypeAndValue.match(str) remain = md.post_match type = md[1] value, tag = (md[2], md[3], md[4]) rescue nil if value type_and_value = [type, value] type_and_value.push(tag) if tag ary.unshift(type_and_value) if remain.length > 2 && remain[0] == ?, str = remain[1..-1] next elsif remain.length > 2 && remain[0] == ?+ raise OpenSSL::X509::NameError, "multi-valued RDN is not supported: #{dn}" elsif remain.empty? break end end end msg_dn = dn[0, dn.length - str.length] + " =>" + str raise OpenSSL::X509::NameError, "malformed RDN: #{msg_dn}" end return ary end