lib/xml/kit/templatable.rb in xml-kit-0.1.0 vs lib/xml/kit/templatable.rb in xml-kit-0.1.1
- old
+ new
@@ -22,16 +22,14 @@
def encryption_for(xml:)
if encrypt?
temp = ::Builder::XmlMarkup.new
yield temp
- signed_xml = signatures.complete(temp.target!)
- xml_encryption = ::Xml::Kit::Builders::Encryption.new(
- signed_xml,
+ ::Xml::Kit::Encryption.new(
+ signatures.complete(temp.target!),
encryption_certificate.public_key
- )
- render(xml_encryption, xml: xml)
+ ).to_xml(xml: xml)
else
yield xml
end
end
@@ -39,10 +37,10 @@
::Xml::Kit::Template.new(model).to_xml(options)
end
def signature_for(reference_id:, xml:)
return unless sign?
- render(signatures.build(reference_id), xml: xml)
+ signatures.build(reference_id).to_xml(xml: xml)
end
# Allows you to specify which key pair to use for generating an XML digital signature.
#
# @param key_pair [Xml::Kit::KeyPair] the key pair to use for signing.