EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Timestamp changed SignedInfo

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#14779
Posted: 10/25/2010 07:10:49
by Martin Hren (Basic support level)
Joined: 10/20/2010
Posts: 13

As Dmytro suggested you should verify your LoadForStream line - try to put it that way:
Code
FXMLDocument.LoadFromStream(F, "utf8", true);


You also should try to remove all new-lines and blank spaces from your original xml file (I think that's your main problem).

Otherwise our code looks similar, except that I don't use TSBTimestampNeededEvent at all - it is generated automatically for me. You also don't need to set SigPropRef values.

Dmytro - The only issue I stil have is not being able to remove SignedSignatureProperties Id, which drives me nuts! Is there ANY other way to get rid of that Id? I'm so close now, but we realy don't have that much time anymore to wait for a new version.

Martin
#14787
Posted: 10/25/2010 10:32:49
by Sašo Osenk (Standard support level)
Joined: 09/20/2010
Posts: 35

I have chnaged code to
Code
    F := TFileStream.Create(dir+'\Racun_'+SifraRacuna+'_omni.xml', fmOpenRead);
    try
      FreeAndNil(FXMLDocument);
    except
    end;
    FXMLDocument := TElXMLDOMDocument.Create;
    try
       FXMLDocument.LoadFromStream(F, 'utf-8',true);
    except
      on E : Exception do
      begin
        MessageDlg('Error: ' + E.Message, mtError, [mbOk], 0);
      end;
    end;

and still isn't ok.
I'm lost here. It have to be something small and I can't find it.
In attachment are both files, file to sign and signed file. Could you please take a look what is wrong?
Martin, a lahko podpišeš moj xml brez podpisa in mi ga pošlješ nazaj?
Thank you.

Sašo


[ Download ]
#14789
Posted: 10/25/2010 10:53:47
by Dmytro Bogatskyy (EldoS Corp.)

Quote
Dmytro - The only issue I stil have is not being able to remove SignedSignatureProperties Id, which drives me nuts! Is there ANY other way to get rid of that Id? I'm so close now, but we realy don't have that much time anymore to wait for a new version.

Are you using .Net or VCL edition?
#14790
Posted: 10/25/2010 12:30:25
by Sašo Osenk (Standard support level)
Joined: 09/20/2010
Posts: 35

VCL.

Sašo
#14791
Posted: 10/25/2010 14:47:51
by Dmytro Bogatskyy (EldoS Corp.)

Quote
I'm lost here. It have to be something small and I can't find it.
In attachment are both files, file to sign and signed file. Could you please take a look what is wrong?

Strange, your code is ok for me. "Recun" element is same as yours, but a digest value for that reference is different.
What version are you using? The latest? From EldoS website? Do you set a license key? Could you post a whole application including dcu's.

Quote
VCL.
Sašo

Sorry, I can guide what to modify in sources or post them only for registered users.
#14796
Posted: 10/26/2010 01:14:27
by Martin Hren (Basic support level)
Joined: 10/20/2010
Posts: 13

I'm using .NET edition, version 8.1.190.

Sašo, here is your signed file (it works for me):


[ Download ]
#14797
Posted: 10/26/2010 01:40:37
by Sašo Osenk (Standard support level)
Joined: 09/20/2010
Posts: 35

Dmytro, it looks that the version is the problem. I have 8.01.74 version which I got from my boss. I now downloaded version from your web site and send a request form temporary unlock key. I hope that this will solve my problem and I can order full version.
Thank you again for all your help. It helped me a lot.

Sašo
#14802
Posted: 10/26/2010 03:37:56
by Sašo Osenk (Standard support level)
Joined: 09/20/2010
Posts: 35

I just got the unlock key and it is all OK. Thank you very much for all your help.
Now only the SignedSignatureProperties.ID is the problem.

Martin, povej kam pa kdaj greva na pivo/kavo.

Sašo
#14804
Posted: 10/26/2010 04:42:55
by Martin Hren (Basic support level)
Joined: 10/20/2010
Posts: 13

Glad you managed to work it out!

Quote
Sorry, I can guide what to modify in sources or post them only for registered users.

By that you mean that we have to purchase a package before? We will definitely order it - if than we'll be able to resolve the ID issue out.

Sašo, v kolikor si kje blizu Maribora, se da kaj dogovorit - pivo je pač težko odklonit:)
#14833
Posted: 10/28/2010 04:55:17
by Sašo Osenk (Standard support level)
Joined: 09/20/2010
Posts: 35

I have some old/new troubles. When I add timestamp, the code is below, I get the same error that before.

Code
    TSPFileClient:=ElFileTSPClient.Create(nil);
    TSPFileClient.IncludeCertificates:=true;
    TSPFileClient.HashAlgorithm:=SB_ALGORITHM_DGST_SHA1;
    TSPFileClient.TSPInfo.TSAName.IpAddress:='http://postarca.posta.si/tsa/CasovniZig.wsdl';
    TSPFIleClient.OnTimestampNeeded:=TSBTimestampNeededEvent;
    XAdESSigner.TSPClient:=TSPFileClient;

Procedure TFeRacun.TSBTimestampNeededEvent(Sender : TObject; RequestStream, ReplyStream: TStream; var Succeeded : boolean);
var srv:TElFileTSPServer;
    r:integer;
begin
  srv:=TElFileTSPServer.create(nil);
  srv.Certificates := TElMemoryCertStorage.create(nil);
  srv.Certificates.Add(NajdiCertifikat,true);
  RequestStream.Position := 0;
  r := srv.LoadRequestFromStream(RequestStream);
  srv.SaveReplyToStream(psGranted, 0, ReplyStream);
  Succeeded := true;
end;

Is my timestamp code ok?
Do you give me warranty that when we buy the SecureBlackBox we will be able to remove SignedSignatureProperties.ID?
Thank's for helping.

Martin, ko bom šel v vaše konce ti sporočim.

Sašo
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 26379 times

Number of guests: 3, 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!