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