Sha256: 79b7a7d20a578530ecd5e9278ca8d40a7e0d36a7220616a07b2db2780c020c14
Contents?: true
Size: 931 Bytes
Versions: 1
Compression:
Stored size: 931 Bytes
Contents
# frozen_string_literal: true module Rails module Auth module X509 # X.509 client certificates obtained from HTTP requests class Certificate attr_reader :certificate def initialize(certificate) unless certificate.is_a?(OpenSSL::X509::Certificate) raise TypeError, "expecting OpenSSL::X509::Certificate, got #{certificate.class}" end @certificate = certificate.freeze @subject = {} @certificate.subject.to_a.each do |name, data, _type| @subject[name.freeze] = data.freeze end @subject.freeze end def [](component) @subject[component.to_s.upcase] end def cn @subject["CN".freeze] end alias common_name cn def ou @subject["OU".freeze] end alias organizational_unit ou end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rails-auth-0.3.0 | lib/rails/auth/x509/certificate.rb |