Module: Saml::Kit::XmlTemplatable
- Includes:
- Xml::Kit::Templatable
- Included in:
- Builders::Assertion, Builders::AuthenticationRequest, Builders::EncryptedAssertion, Builders::IdentityProviderMetadata, Builders::LogoutRequest, Builders::LogoutResponse, Builders::Metadata, Builders::Response, Builders::ServiceProviderMetadata
- Defined in:
- lib/saml/kit/xml_templatable.rb
Instance Method Summary collapse
- #digest_method ⇒ Object
- #encrypt_with(key_pair) ⇒ Object
-
#sign? ⇒ Boolean
Returns true if an embedded signature is requested and at least one signing certificate is available via the configuration.
- #signature_method ⇒ Object
- #signing_key_pair ⇒ Object
- #template_path ⇒ Object
Instance Method Details
#digest_method ⇒ Object
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.
13 14 15 16 17 |
# File 'lib/saml/kit/xml_templatable.rb', line 13 def sign? return configuration.sign? if .nil? ( && configuration.sign?) || ( && signing_key_pair.present?) end |
#signature_method ⇒ Object
28 29 30 |
# File 'lib/saml/kit/xml_templatable.rb', line 28 def signature_method configuration.signature_method end |
#signing_key_pair ⇒ Object
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_path ⇒ Object
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 |