Module: Saml::Kit::Trustable

Extended by:
ActiveSupport::Concern
Included in:
Document
Defined in:
lib/saml/kit/trustable.rb

Overview

This module is responsible for validating the trustworthiness of a saml document.

Instance Method Summary collapse

Instance Method Details

#signed?Boolean

Returns true when the document has an embedded XML Signature or has been verified externally.

Returns:

  • (Boolean)


18
19
20
# File 'lib/saml/kit/trustable.rb', line 18

def signed?
  signature_manually_verified || signature.present?
end

#trusted?Boolean

Returns true when documents is signed and the signing certificate belongs to a known service entity.

Returns:

  • (Boolean)


28
29
30
31
32
# File 'lib/saml/kit/trustable.rb', line 28

def trusted?
  return true if signature_manually_verified
  return false unless signed?
  signature.trusted?(provider)
end