lib/saml/kit/fingerprint.rb in saml-kit-0.2.0 vs lib/saml/kit/fingerprint.rb in saml-kit-0.2.1
- old
+ new
@@ -2,13 +2,10 @@
module Kit
class Fingerprint
attr_reader :x509
def initialize(raw_certificate)
- @x509 = OpenSSL::X509::Certificate.new(raw_certificate)
- rescue OpenSSL::X509::CertificateError => error
- Saml::Kit.logger.warn(error)
- @x509 = OpenSSL::X509::Certificate.new(Base64.decode64(raw_certificate))
+ @x509 = Certificate.to_x509(raw_certificate)
end
def algorithm(algorithm)
pretty_fingerprint(algorithm.new.hexdigest(x509.to_der))
end