Class: Backends::Opennebula::Authn::CloudAuth::X509Auth

Inherits:
Object
  • Object
show all
Defined in:
lib/backends/opennebula/authn/cloud_auth/x509_auth.rb

Overview

X509 authentication class.

Class Method Summary collapse

Class Method Details

.escape_dn(dn) ⇒ Object


20
21
22
# File 'lib/backends/opennebula/authn/cloud_auth/x509_auth.rb', line 20

def self.escape_dn(dn)
  dn.gsub(/\s/) { |s| '\\' + s[0].ord.to_s(16) }
end

.unescape_dn(dn) ⇒ Object


24
25
26
# File 'lib/backends/opennebula/authn/cloud_auth/x509_auth.rb', line 24

def self.unescape_dn(dn)
  dn.gsub(/\\[0-9a-f]{2}/) { |s| s[1, 2].to_i(16).chr }
end