Email with two attachments ( xml and SIgnature)

Hello Everyone,
I do have a typical scenerio where I have to add two attachments to the email . we have configured the Smtp port and I created the the attachment ( which is an XML file ). Now partner wants us to sign the XML message and send that signature file as another attachment. So the message will be a MULTIPART message. My problem is how do I create a Signature file for the XML document and send that as a seperate file to the Partner? Please let me know

Thanks for your support
Kris

Hi Kris,

Looking through the wm documentation (Using_XML_Signature_and_XML_Encryption_with_Integration_Server.pdf) here are the services you can use to sign the document:

  • pub.xmlsec.sign: generates a signature enveloped in a document
  • pub.xmlsec.signEnveloping: generates a signature that envelopes a document
  • pub.xmlsec.verify: verifies signatures of all types

It also says:
“To obtain the code for the XMLSec package, send an email to security@webMethods.com, and a copy of the package will be emailed back.”

Then to send the MULTIPART message you can use the MIME services of the WmPublic package to send the mail with to attachments:
pub.mime:addBodyPart
pub.mime:addMimeHeader
pub.mime:createMimeData
pub.mime:getEnvelopeStream
(…)

Hope that’ll make it.
Mathieu

Hi,
Thank you for the response. Here is the approach I took to resolve it .

  1. we have the email port pretty much configured to receive emails.
  2. the receiving service will take the content based on the Email ( for validation) , creates Mimedata ( using pub.mime.createMimedata) and check for the signature ( using pub.smime.processSignedData) and based on verify Tab result we extract the data and Submit the Xml to TN

On the converse side sending email with two attachments 1) Xml document and 2) signature file

  1. extracted the data from Tn using Tn services and Used service pub.security.pkcs7:sign to generate the signature. used pub.String:base64encoding to generate the string and attached these two files to the SMtp service.
    mathieu, Thank you for your response
    Kris

hi can some share this pdf
Using_XML_Signature_and_XML_Encryption_with_Integration_Server.pdf

thanks in advance