EldoS | Feel safer!

Software components for data protection, secure storage and transfer

CounterSignature, Add one ...

Posted: 11/22/2007 13:00:14
by Nuno Guedes (Basic support level)
Joined: 08/13/2007
Posts: 87

no problem, i am here to help you too
Posted: 07/28/2013 11:04:25
by Popeye  (Basic support level)
Joined: 10/22/2010
Posts: 10

I'm using this code for adding a countersignature to a xades signature.

Bogatskyy wrote:
            TElXMLSigner CSigner = new TElXMLSigner();
            CSigner.References = new TElXMLReferenceList();
            // add other references ...
            // CSigner.UpdateReferencesDigest();
            // add references pointing to elements inside the main signature
            Ref = new TElXMLReference();
            Ref.RefType = SBXMLDefs.Unit.xmlRefTypeCountersignedSignature;
            Ref.URI = "#SignatureValue-0";
            CSigner.KeyData = X509KeyData;
            CSigner.CanonicalizationMethod = SBXMLDefs.Unit.xcmCanon;
            CSigner.SignatureMethodType = SBXMLSec.Unit.xmtSig;
            CSigner.SignatureMethod = SBXMLSec.Unit.xsmRSA_SHA1;
            // CSigner.IncludeKey = false;

It's working fine but the ds:Object and its sub nodes isnt present in xades:CounterSignature. How can i add ds:Object node in xades:CounterSignature

Posted: 07/30/2013 04:30:36
by Dmytro Bogatskyy (Team)

Thank you for contacting us.

In general a xades:CounterSignature shouldn't replicate structure of original signature, it should only sign a ds:SignatureValue element that is done by your code.
If you want to add a XAdES info or add additional objects into xades:CounterSignature then you can do it in the same way as for standard signature.
For example to add additional ds:Object, you can use a following code:
TElXMLObject obj = new TElXMLObject();
TElXMLDOMText ObjText = XMLDocument.CreateText('text/base64 data');



Topic viewed 6570 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!