EldoS | Feel safer!

Software components for data protection, secure storage and transfer

How to include Cert info in XML Signed w/ distributed Cryptography

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#22613
Posted: 11/22/2012 07:09:03
by Daniel Oliveira (Basic support level)
Joined: 11/20/2012
Posts: 19

I'm using the Distributed Cryptography Add-on to sign XML files, but must include the information in the signature certificate used (X509Data). I need to display the information and the signature certificate used on a specific page.

thank you
#22614
Posted: 11/22/2012 07:16:12
by Vsevolod Ievgiienko (EldoS Corp.)

Hello.

You can enable this using ((TElXMLKeyInfoX509Data)TElXMLSigner.KeyData).IncludeDataParams property. Please refer to the documentation for details: http://www.eldos.com/documentation/sb...arams.html
#22615
Posted: 11/22/2012 07:51:57
by Daniel Oliveira (Basic support level)
Joined: 11/20/2012
Posts: 19

Thank you for the awnser.

I put this code on my PreSigner class:

Quote
((TElXMLKeyInfoX509Data) signer.KeyData).IncludeDataParams = SBXMLSec.Unit.xkidX509Certificate;


Correct?

But, in result.aspx page the property KeyData is null.
#22616
Posted: 11/22/2012 07:56:23
by Vsevolod Ievgiienko (EldoS Corp.)

It must be assigned manually. Please refer to the next sample for details: \EldoS\SecureBlackbox.NET\Samples\C#\XMLBlackbox\Signer
#22619
Posted: 11/22/2012 08:30:27
by Dmytro Bogatskyy (EldoS Corp.)

You would need to create an instance of TElXMLKeyInfoX509Data, and then set a Certificate property with a signing certificate. To obtain a signing certificate from a state object, please do following:
Code
  TElDCBaseMessage Msg = State.FindMessageByType(TElDCOperationResponseMessage);
  if (Msg != null)
  {
    byte[] buf = TElDCOperationResponseMessage(Msg).KeysRDN.GetFirstValueByOID(      SBDCPKIConstants.Unit.SB_OID_DC_SIGNING_CERTIFICATE)
   // then load certificate from a buffer
  }


P.S. Please also ensure that TElXMLSigner.IncludeKey property is set to true for both steps.
#22622
Posted: 11/22/2012 12:06:06
by Daniel Oliveira (Basic support level)
Joined: 11/20/2012
Posts: 19

Thanks, Dmytro and Vesevolod.

Works, with a little adjusts. I will put here the code for future references:

Code
byte[] buf = ((TElDCOperationResponseMessage)Msg).KeysRDN.GetFirstValueByOID(SBDCPKIConstants.Unit.SB_OID_DC_SIGNING_CERTIFICATE);
                var cert = new TElX509Certificate();
                cert.LoadFromBuffer(buf);
Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.

Reply

Statistics

Topic viewed 834 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!