Sha256: fbe5d2f469b4a574e67709166e868a9b802781eae19176288c30b4647c1ed4a7

Contents?: true

Size: 537 Bytes

Versions: 11

Compression:

Stored size: 537 Bytes

Contents

require "java"
require "stringio"

module Rails
  module Auth
    module X509
      module Filter
        # Extract OpenSSL::X509::Certificates from Java's sun.security.x509.X509CertImpl
        class Java
          def call(cert)
            OpenSSL::X509::Certificate.new(extract_der(cert)).freeze
          end

          private

          def extract_der(cert)
            stringio = StringIO.new
            cert.derEncode(stringio.to_outputstream)
            stringio.string
          end
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rails-auth-1.1.0 lib/rails/auth/x509/filter/java.rb
rails-auth-1.0.0 lib/rails/auth/x509/filter/java.rb
rails-auth-0.5.3 lib/rails/auth/x509/filter/java.rb
rails-auth-0.5.2 lib/rails/auth/x509/filter/java.rb
rails-auth-0.5.1 lib/rails/auth/x509/filter/java.rb
rails-auth-0.5.0 lib/rails/auth/x509/filter/java.rb
rails-auth-0.4.1 lib/rails/auth/x509/filter/java.rb
rails-auth-0.4.0 lib/rails/auth/x509/filter/java.rb
rails-auth-0.3.0 lib/rails/auth/x509/filter/java.rb
rails-auth-0.2.0 lib/rails/auth/x509/filter/java.rb
rails-auth-0.1.0 lib/rails/auth/x509/filter/java.rb