EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Pdf timestamping via https

Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.
#23231
Posted: 01/17/2013 06:02:06
by David Eršil (Standard support level)
Joined: 01/15/2013
Posts: 34

Hello,
I tried to use the TinySigner C# sample from 10.0.230 version to timestamp my pdf and I need to use https service (with basic authentication). I have implemented the TSBCertificateValidateEvent, which seems to work, but the problem is that the attributes of TElHTTPTSPClient.RequestParameters (username and password etc) that are advised in this forum to be used for authentication are not available to me.
Can you please help me how to use the https authentication properly?

EDIT: I forgot to mention that I'm using the .NET assembly for WinRT.
#23235
Posted: 01/17/2013 06:08:39
by Vsevolod Ievgiienko (EldoS Corp.)

David,

thank you for getting in touch with us.

If the server requires basic authentication then you MUST know username and password to use it. Otherwise it will simply reject your requests as unauthorized.
#23236
Posted: 01/17/2013 06:17:56
by David Eršil (Standard support level)
Joined: 01/15/2013
Posts: 34

Hi Vsevolod,

thank you for your response.

I know them of course. The problem is I cannot use these properties in the source code of the sample. See this part of the TinySigner C# sample project (starting on line 621):

Code
// configuring timestamping settings
if (cbTimestamp.Checked)
{
  HTTPClient.OnCertificateValidate += new TSBCertificateValidateEvent(ValidateCert);

  TSPClient.HTTPClient = HTTPClient;
  TSPClient.HTTPClient.RequestParameters.Username = "user123";  //this is where the problem occurs - Visual Studio 2012 complains that SBHTTPSClient.TElHTTPRequestParams does not contain a definition for Username

  TSPClient.HashAlgorithm = SBConstants.Unit.SB_ALGORITHM_DGST_SHA1;
  TSPClient.URL = tbTimestampServer.Text;
  PublicKeyHandler.TSPClient = TSPClient;
}


Is there some namespace or assembly missing? I tried to look up in this forum as well as documentation but have not been successful...
#23239
Posted: 01/17/2013 06:28:41
by Vsevolod Ievgiienko (EldoS Corp.)

Sorry, I didn't understand your question. Please add SecureBlackbox.HTTPCommon.dll assembly to the project.
#23241
Posted: 01/17/2013 06:35:44
by Eugene Mayevski (EldoS Corp.)

Quote
David Eršil wrote:
//this is where the problem occurs - Visual Studio 2012 complains that SBHTTPSClient.TElHTTPRequestParams does not contain a definition for Username


Does the problem happen when you add something or the sample can not be compiled as-is, without your modification?


Sincerely yours
Eugene Mayevski
#23243
Posted: 01/17/2013 07:02:52
by David Eršil (Standard support level)
Joined: 01/15/2013
Posts: 34

Eugene, the sample can be compiled as is, it also works when I add the certificate validation handling. But it fails to compile when I try to use TElHTTPRequestParams.Username (or Password or whatever, even the IntelliSense doesn't offer them).

I added the SecureBlackbox.HTTPCommon.dll to the project as Vsevolod suggested and it seems to be working now (although I'm getting 83970 error - no reply from server, but that could mean some other problem I am not seeing right now).

Thanks a lot for your help!
#23248
Posted: 01/18/2013 03:17:26
by David Eršil (Standard support level)
Joined: 01/15/2013
Posts: 34

Allow me one more question here.

If I am not mistaken, the TElPDFDocument class is usable only on desktop as its Open method takes the System.IO.FileStream parameter, but this namespace is not available in WinRT.
Do you plan to support PDF signing also under WinRT in some future SecureBlackbox release (e.g. by overriding Open method to take byte array or something like that)?

Thanks.
#23249
Posted: 01/18/2013 03:32:08
by Vsevolod Ievgiienko (EldoS Corp.)

You can use next code:

Code
using System.IO;
...

StorageFile theFile = await ApplicationData.Current.LocalFolder.CreateFileAsync(File.GetFileName(FilePath), CreationCollisionOption.OpenIfExists);
Stream F = (await theFile.OpenAsync(FileAccessMode.ReadWrite)).AsStream();
TElPDFDocument Document = new TElPDFDocument();
Document.Open(F);
#23262
Posted: 01/18/2013 07:40:11
by David Eršil (Standard support level)
Joined: 01/15/2013
Posts: 34

That's amazing!
Thank you very very much for your support, Vsevolod!
Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.

Reply

Statistics

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