Sha256: 351b276e9989872d2e41e7a29dc0c598a1f60b8fb101da7a04351535a5d87704
Contents?: true
Size: 1.08 KB
Versions: 1
Compression:
Stored size: 1.08 KB
Contents
module Saml module Kit module Templatable attr_accessor :sign def to_xml(xml: ::Builder::XmlMarkup.new) signatures.complete(render(self, xml: xml)) end def signature_for(reference_id:, xml:) return unless sign? render(signatures.build(reference_id), xml: xml) end def sign? sign.nil? ? configuration.sign? : sign && configuration.sign? end def signatures @signatures ||= Saml::Kit::Signatures.new(configuration: configuration) end def encryption_for(xml:) if encrypt? temp = ::Builder::XmlMarkup.new yield temp signed_xml = signatures.complete(temp.target!) xml_encryption = Saml::Kit::Builders::XmlEncryption.new(signed_xml, encryption_certificate.public_key) render(xml_encryption, xml: xml) else yield xml end end def encrypt? encrypt && encryption_certificate end def render(model, options) Saml::Kit::Template.new(model).to_xml(options) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
saml-kit-0.2.6 | lib/saml/kit/templatable.rb |