Skip navigation
Currently Being Moderated

XML SIGNATURE

Aug 19, 2009 2:10 AM

How exactly can i add xml signatures in my form ? Also if my form contain 100 fields , is there a generic way by which i can get the data from all the fields.

Thanks

 
Replies
  • Currently Being Moderated
    Aug 19, 2009 5:53 AM   in reply to amateur85

    The XML gets signed when the data is submitted.  You need to use LiveCycle Designer ES and add a submit button to your form.  Configure the button to submit XML Data or XDP, and then enable the "Sign Submission" property (found on the "Submit" tab.

     

    When the submit button is clicked, you will be prompted to pick the digital certificate (credential) to be used to create the signature.

     

    Regards

    Steve

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 20, 2009 5:12 AM   in reply to amateur85

    If you want to get all of the data inside of a script then you can use this command:

     

    xfa.datasets.data.saveXML("pretty");

     

    If you want to save the data to a file then use this command:

     

    xfa.host.exportData("", true);

     

    This wil bring up a dialog and allow you to choose the filename of the xml file you want to save. Note that you cannot save the file without the dialog.

     

    Paul

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 20, 2009 6:00 AM   in reply to pguerett

    When using XML Dig Sig to sign the XML data or XDP (XML Data Package) there is no visual representation (i.e. Signature Field) of the signature like there is with a PDF signature.

     

    I believe It may be possible to generate an XML DigSig without a submit button (as I mentioned in my previous post), but it don't believe it can be done on the preSign event of a PDF Signature field.  I will create a sample ond post it as soon as possible.

     

    Regards

    Steve

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 20, 2009 6:29 AM   in reply to SForrest96

    The "preSubmit" event can be used (with caveats)

     

    Sample posted here...

     

    http://forums.adobe.com/message/2192131#2192131

     

    Steve

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 19, 2010 5:33 AM   in reply to SForrest96

    Hi Steve,

     


    Thanks for your reply for this issue.

     


    I have compared the xml schema generated by javascript and through submit button.

     


    javascript for signature

     

    xfa.signature.sign(this.parent.TextField1.dataNode, "$data.signatures", "mySignature");
    var sigxml = xfa.datasets.data.signatures.saveXML();

     


    If i passed both the signed xml for verify signature process then signature status is coming as false for xml generated by script and true for submit button.

     


    I want to check data tampering with xml in my application. signature status will be the best option to check data tampering.

     


    please find the xml schema from both the option and you may get the difference in xml generated as some values get missing in script genrated xml.

     


    what is the way to reproduce same signed xml as of from submit button with javascript?

     


    Please reply for this too.

     


    Regards

     

    Abhishek

     

    This is signed xml generated by submit button.

     

    <?xml version="1.0" encoding="UTF-8"?>
    <xfa:data xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"
    ><form1
    ><main1
    ><Amount
    >888888888.00</Amount
    ><PayNo
    >7777</PayNo
    ></main1
    ><SignerInfo xfa:dataNode="dataGroup"
    /><UniqueReferenceNo
    >RUSS0110201008541386940418200000</UniqueReferenceNo
    ></form1
    ><signatures
    ><Signature xmlns="http://www.w3.org/2000/09/xmldsig#" Id="datasignature_1"
    ><SignedInfo
    ><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments"
    /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"
    /><Reference URI="#id5662bdab" Type="http://www.w3.org/2000/09/xmldsig#SignatureProperties"
    ><Transforms
    ><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments"
    /></Transforms
    ><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"
    /><DigestValue
    >YDEJ0mdJxBk=</DigestValue
    ></Reference
    ><Reference URI=""
    ><Transforms
    ><Transform Algorithm="http://www.w3.org/2002/06/xmldsig-filter2"
    ><XPath xmlns="http://www.w3.org/2002/06/xmldsig-filter2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Filter="intersect"
    >here()/ancestor::dsig:Signature[1]/../../form1[1]//. |
    here()/ancestor::dsig:Signature[1]/../../form1[1]//@* |
    here()/ancestor::dsig:Signature[1]/../../form1[1]//namespace::*</XPath
    ></Transform
    ><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments"
    /></Transforms
    ><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"
    /><DigestValue
    >sj/JGvQtNpR4Z9YBI=</DigestValue
    ></Reference
    ></SignedInfo
    ><SignatureValue
    >za0Uh08alHBd8JhclU6fKm6m9bCDxhQF8nETGcMvVGCYhaUxnxSaCcMcRsOPOCajc
    i9GpA51lPsiyYTOlQj0=</SignatureValue
    ><KeyInfo
    ><X509Data
    ><X509Certificate
    >MISK+6GhTxwIDAQABoyAwHjAPBgkqhkiG9y8BAQoEAgUAMAsG
    A1UdDwQEAwIEkDANBgkqhkiG9w0BAQUFAAOBgQCd6/SXf6E4Dt632hJ1ShUhGJjMfyrwS2 YJa6/z
    w1mny1/gFNitalDPqlaM8bLKWg4f3IiKB/Nxvh/jD3LeX/yU8eOAaNhgP9zB6O2zZpF2yt m/kOKk
    8LMz3r2hnF2ak0B6jkjpkqp6QFwOQ+i2n54RMh8B/Z5t8Njm5EJVZ2lMmw==</X509Cert ificate
    ></X509Data
    ></KeyInfo
    ><Object
    ><SignatureProperties Id="id5662bdab"
    ><SignatureProperty Target="datasignature_1"
    ><PROP_Sig xmlns="http://ns.adobe.com/pdf/2006" type="cabinet"
    ><M type="text"
    >D:20101001085603+01'00'</M
    ><Name type="text"
    >Nitin</Name
    ></PROP_Sig
    ></SignatureProperty
    ></SignatureProperties
    ></Object
    ></Signature
    ></signatures
    ></xfa:data
    >

     

    This is the signed xml generated by javascript as above

     

    <?xml version="1.0" encoding="UTF-8"?>

     

    <signatures
    ><Signature  Id="SignatureField1"
    ><SignedInfo
    ><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments"
    /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"
    /><Reference URI="#idcfb6b87b" Type="http://www.w3.org/2000/09/xmldsig#SignatureProperties"
    ><Transforms
    ><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments"
    /></Transforms
    ><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"
    /><DigestValue
    >aPZheqH7JE=</DigestValue
    ></Reference
    ><Reference URI=""
    ><Transforms
    ><Transform Algorithm="http://www.w3.org/2002/06/xmldsig-filter2"
    ><XPath Filter="intersect" xmlns="http://www.w3.org/2002/06/xmldsig-filter2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"
    >here()/ancestor::dsig:Signature[1]/../../form1[1]/main1[1]/formdata[1 ]//. |
    here()/ancestor::dsig:Signature[1]/../../form1[1]/main1[1]/formdata[1] //@* |
    here()/ancestor::dsig:Signature[1]/../../form1[1]/main1[1]/formdata[1] //namespace::*</XPath
    ></Transform
    ><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments"
    /></Transforms
    ><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"
    /><DigestValue
    >J9PpL3DLDrjVE=</DigestValue
    ></Reference
    ></SignedInfo
    ><SignatureValue
    >iKs30Iu3zHpvx0J8CWlkAwuFtq7ehVFh
    /WQzvgBXQdn+tBFRo0A=</SignatureValue
    ><KeyInfo
    ><X509Data
    ><X509Certificate
    >MIIjUWHsp1U1DxWUl2yB3mMLCXC8u4NZn1lj5N4ofdjwwNDxylTo
    bZU8hedHbAFMesWRdInCM5jDWiAw/SK+6GhTxwIDAQABoyAwHjAPBgkqhkiG9y8BAQoEAg UAMAsG
    A1UdDwQEAwIEkDANBgkqhkig4f3IiKw==</X509Certificate
    ></X509Data
    ></KeyInfo
    ><Object
    ><SignatureProperties Id="idcfb6b87b"
    ><SignatureProperty Target="SignatureField1"
    ><PROP_Sig xmlns="http://ns.adobe.com/pdf/2006" type="cabinet"
    ><M type="text"
    >D:20101001085926+01'00'</M
    ><Name type="text"
    >Nitin</Name
    ></PROP_Sig
    ></SignatureProperty
    ></SignatureProperties
    ></Object
    ></Signature
    ></signatures
    >

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points