EldoS | Feel safer!

Software components for data protection, secure storage and transfer

TSP RFC3161

Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.
#8995
Posted: 02/20/2009 10:21:59
by Qualisoft CQPD (Standard support level)
Joined: 03/13/2007
Posts: 55

I am using SBB 5.2.0.124 Microsoft Visual Studio 2005. I think the TElFileTSPServer.SaveReplyToStream generate the TimeStampResp but when i save this stream to a file and open them in an ASN1 viewer i can´t identify the PKIStatusInfo structure.

TimeStampResp ::= SEQUENCE {
status PKIStatusInfo,
timeStampToken TimeStampToken OPTIONAL }


i find only the timeStampToken structure.

thanks for help.
#8996
Posted: 02/20/2009 10:39:09
by Ken Ivanov (EldoS Corp.)

Would you be so kind to post the created TSP response here?
#8997
Posted: 02/20/2009 10:48:43
by Qualisoft CQPD (Standard support level)
Joined: 03/13/2007
Posts: 55

yes sure.


[ Download ]
#8998
Posted: 02/20/2009 11:47:07
by Ken Ivanov (EldoS Corp.)

Thank you. The attached file really does not contain a PKIStatusInfo structure. Will be checked.
#9005
Posted: 02/23/2009 02:51:26
by Ken Ivanov (EldoS Corp.)

How exactly did you generate the response you've attached? With the below code the response is created correctly.
Code
private void button1_Click(object sender, System.EventArgs e)
{
   TElFileTSPClient cli = new TElFileTSPClient();
   cli.OnTimestampNeeded += new TSBTimestampNeededEvent(cli_OnTimestampNeeded);
   int serverResult = 0;
   int failureInfo = 0;
   byte[] replyCMS = null;
   int r = cli.Timestamp(new byte[20], out serverResult, out failureInfo, out replyCMS);
}

private void cli_OnTimestampNeeded(object Sender, System.IO.Stream RequestStream, System.IO.Stream ReplyStream, ref bool Succeeded)
{
   TElFileTSPServer srv = new TElFileTSPServer();
   srv.Certificates = new TElMemoryCertStorage();
   FileStream f = new FileStream("C:\\Projects\\SecureBlackbox\\Certificates\\cert.pfx", FileMode.Open);
   try
   {
      TElX509Certificate crt = new TElX509Certificate();
      crt.LoadFromStreamPFX(f, "password", 0);
      srv.Certificates.Add(crt, true);
   }
   finally
   {
      f.Close();
   }
   RequestStream.Position = 0;
        int r = srv.LoadRequestFromStream(RequestStream);         
   srv.SaveReplyToStream(SBPKICommon.Unit.psGranted, 0, ReplyStream);
   Succeeded = true;
}
#9026
Posted: 02/24/2009 05:44:04
by Qualisoft CQPD (Standard support level)
Joined: 03/13/2007
Posts: 55

Sorry, we are in holiday until Thursday.
I will post my code as soon as possible.

thanks
#9051
Posted: 02/26/2009 05:32:40
by Qualisoft CQPD (Standard support level)
Joined: 03/13/2007
Posts: 55

Does not work to me.

Project in the ZIP.

thanks for help.


[ Download ]
#9052
Posted: 02/26/2009 06:02:20
by Ken Ivanov (EldoS Corp.)

The value you are writing to the "c:\assinadoric.p7s" file is not a whole TSP response, but a TimeStampToken object extracted from the response. The whole response should be taken from the ReplyStream object in the OnTimestampNeeded event handler.
#9053
Posted: 02/26/2009 06:29:55
by Qualisoft CQPD (Standard support level)
Joined: 03/13/2007
Posts: 55

sorry for the inconvenience.
Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages

Reply

Statistics

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