Module: Saml::Kit::Trustable

Extended by:
ActiveSupport::Concern
Included in:
Document
Defined in:
lib/saml/kit/concerns/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)


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

def signed?
  signature_verified || signature.present?
end

#trusted?Boolean

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

Returns:

  • (Boolean)


30
31
32
33
34
35
# File 'lib/saml/kit/concerns/trustable.rb', line 30

def trusted?
  return true if signature_verified
  return false unless signed?

  signature.trusted?(provider)
end