EldoS | Feel safer!

Software components for data protection, secure storage and transfer

CounterSignature, Add one ...

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#4384
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
#25858
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.

Quote
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.References.Add(Ref);
            CSigner.KeyData = X509KeyData;
            CSigner.CanonicalizationMethod = SBXMLDefs.Unit.xcmCanon;
            CSigner.SignatureMethodType = SBXMLSec.Unit.xmtSig;
            CSigner.SignatureMethod = SBXMLSec.Unit.xsmRSA_SHA1;
            // CSigner.IncludeKey = false;
            xadesSigner.AddCounterSignature(CSigner);



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

Thanks
#25876
Posted: 07/30/2013 04:30:36
by Dmytro Bogatskyy (EldoS Corp.)

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:
Code
CSigner.GenerateSignature();
...
TElXMLObject obj = new TElXMLObject();
TElXMLDOMText ObjText = XMLDocument.CreateText('text/base64 data');
obj.DataList.Add(ObjText);
CSigner.Signature.Objects.Add(obj);
...
xadesSigner.AddCounterSignature(CSigner);

Reply

Statistics

Topic viewed 6255 times

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




|

Back to top

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

Got it!