Sha256: 4e469663dc4643a1bb7fc1ff6f0538aa24d71c27cb9bb59f0880987fc815f0e5

Contents?: true

Size: 851 Bytes

Versions: 103

Compression:

Stored size: 851 Bytes

Contents

module Saml
  module Elements
    class KeyInfo
      class X509Data
        include Saml::Base

        tag 'X509Data'
        namespace 'ds'

        element :x509certificate, String, :tag => "X509Certificate", :on_save => lambda { |c| c.present? ? Base64.encode64(c.to_der) : "" }

        validates :x509certificate, :presence => true

        def initialize(cert = nil)
          self.x509certificate = cert
        end

        def x509certificate=(cert)
          if cert.present?
            if cert =~ /-----BEGIN CERTIFICATE-----/
              @x509certificate = OpenSSL::X509::Certificate.new(cert)
            else
              @x509certificate = OpenSSL::X509::Certificate.new(Base64.decode64(cert))
            end
          end
        rescue OpenSSL::X509::CertificateError => e
          nil
        end
      end
    end
  end
end

Version data entries

103 entries across 103 versions & 1 rubygems

Version Path
libsaml-3.3.0 lib/saml/elements/key_info/x509_data.rb
libsaml-3.2.3 lib/saml/elements/key_info/x509_data.rb
libsaml-3.2.2 lib/saml/elements/key_info/x509_data.rb
libsaml-3.2.1 lib/saml/elements/key_info/x509_data.rb
libsaml-3.1.2 lib/saml/elements/key_info/x509_data.rb
libsaml-3.1.1 lib/saml/elements/key_info/x509_data.rb
libsaml-3.1.0 lib/saml/elements/key_info/x509_data.rb
libsaml-3.0.9 lib/saml/elements/key_info/x509_data.rb
libsaml-2.24.3 lib/saml/elements/key_info/x509_data.rb
libsaml-2.24.2 lib/saml/elements/key_info/x509_data.rb
libsaml-3.0.8 lib/saml/elements/key_info/x509_data.rb
libsaml-3.0.7 lib/saml/elements/key_info/x509_data.rb
libsaml-3.0.6 lib/saml/elements/key_info/x509_data.rb
libsaml-3.0.5 lib/saml/elements/key_info/x509_data.rb
libsaml-3.0.4 lib/saml/elements/key_info/x509_data.rb
libsaml-3.0.3 lib/saml/elements/key_info/x509_data.rb
libsaml-3.0.2 lib/saml/elements/key_info/x509_data.rb
libsaml-3.0.1 lib/saml/elements/key_info/x509_data.rb
libsaml-2.24.1 lib/saml/elements/key_info/x509_data.rb
libsaml-2.23.2 lib/saml/elements/key_info/x509_data.rb