lib/saml2/key.rb in saml2-1.0.5 vs lib/saml2/key.rb in saml2-1.0.6
- old
+ new
@@ -27,9 +27,17 @@
def signing?
use.nil? || use == Type::SIGNING
end
+ def certificate
+ @certificate ||= OpenSSL::X509::Certificate.new(Base64.decode64(x509))
+ end
+
+ def fingerprint
+ @fingerprint ||= Digest::SHA1.hexdigest(certificate.to_der).gsub(/(\h{2})(?=\h)/, '\1:')
+ end
+
def build(builder)
builder['md'].KeyDescriptor do |builder|
builder.parent['use'] = use if use
builder['dsig'].KeyInfo do |builder|
builder['dsig'].X509Data do |builder|