Module: Saml::Kit::XmlTemplatable

Instance Method Summary collapse

Instance Method Details

#digest_methodObject



24
25
26
# File 'lib/saml/kit/xml_templatable.rb', line 24

def digest_method
  configuration.digest_method
end

#encrypt_with(key_pair) ⇒ Object



19
20
21
22
# File 'lib/saml/kit/xml_templatable.rb', line 19

def encrypt_with(key_pair)
  self.encrypt = true
  self.encryption_certificate = key_pair.certificate
end

#sign?Boolean

Returns true if an embedded signature is requested and at least one signing certificate is available via the configuration.

Returns:

  • (Boolean)


13
14
15
16
17
# File 'lib/saml/kit/xml_templatable.rb', line 13

def sign?
  return configuration.sign? if embed_signature.nil?
  (embed_signature && configuration.sign?) ||
    (embed_signature && signing_key_pair.present?)
end

#signature_methodObject



28
29
30
# File 'lib/saml/kit/xml_templatable.rb', line 28

def signature_method
  configuration.signature_method
end

#signing_key_pairObject



32
33
34
# File 'lib/saml/kit/xml_templatable.rb', line 32

def signing_key_pair
  @signing_key_pair || configuration.key_pairs(use: :signing).last
end

#template_pathObject



6
7
8
9
10
# File 'lib/saml/kit/xml_templatable.rb', line 6

def template_path
  root_path = __dir__
  template_name = "#{self.class.name.split('::').last.underscore}.builder"
  File.join(root_path, 'builders/templates/', template_name)
end