lib/saml/kit/signature.rb in saml-kit-1.0.12 vs lib/saml/kit/signature.rb in saml-kit-1.0.13
- old
+ new
@@ -24,11 +24,11 @@
end
# Returns true when the fingerprint of the certificate matches one of the certificates registered in the metadata.
def trusted?(metadata)
return false if metadata.nil?
- metadata.matches?(certificate.fingerprint, use: :signing)
+ metadata.matches?(certificate.fingerprint, use: :signing).present?
end
def digest_value
at_xpath('./ds:SignedInfo/ds:Reference/ds:DigestValue').try(:text)
end
@@ -60,14 +60,14 @@
node.search('./ds:SignedInfo/ds:Reference/ds:Transforms/ds:Transform/@Algorithm', Saml::Kit::Document::NAMESPACES).try(:map, &:value)
end
# Returns the XML Hash.
def to_h
- @xml_hash ||= present? ? Hash.from_xml(to_xml)['Signature'] : {}
+ @to_h ||= present? ? Hash.from_xml(to_xml)['Signature'] : {}
end
def present?
- node
+ node.present?
end
def to_xml(pretty: false)
pretty ? node.to_xml(indent: 2) : node.to_s
end