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.
#14753
Posted: 10/22/2010 01:24:57
by Sašo Osenk (Standard support level)
Joined: 09/20/2010
Posts: 35

I have a question only for Martin so I write in Slovenian.

Martin a mi lahko poveš kako preverjaš pravilnost e-racuna?
Hvala.

Sašo
#14754
Posted: 10/22/2010 03:11:47
by Martin Hren (Basic support level)
Joined: 10/20/2010
Posts: 13

Sašo, račune preverjam preko proXSign modula (GZS ga označuje kot verodostojen verifikator), samo shemo pa lahko preveriš npr. preko [URL=http://tools.decisionsoft.com/schemaValidate/index.jsp]te strani[/URL].

Mi lahko poveš, če je tebi uspelo odstraniti vse neveljavne Id-je? Meni namreč manjka samo še odstranitev iz SignedSignatureProperties elementa, ki pa ga nikakor ne morem odstraniti (bo kot izgleda potrebno počakati na novo verzijo).

Primerjal sem tudi najino kodo in opazil eno mogoče bistveno razliko - ti se pri referencah sklicuješ na:
Code
Ref.UriNode := FXMLDocument.DocumentElement;


Moja vrstica je:
Code
Ref1.URINode = FXMLDocument.GetElementByID("data");


Pomembno je, da ti tukaj najde element Racun in ne katerega drugega, tako da lahko mogoče preveriš, če je morda tukaj tvoja težava.

Lp,
Martin
#14757
Posted: 10/22/2010 07:03:08
by Sašo Osenk (Standard support level)
Joined: 09/20/2010
Posts: 35

It seems that I have trouble with references. Below is the error from new testing modul. Any idea what am I doing wrong?
Quote
Reference URI="#data" failed to verify
Reference URI="#SignedPropertiesId" failed to verify
Validation of <SignedInfo> failed

Martin, a mi lahko poveš kako imaš nastavljene reference pri sebi?
Hvala.

Sašo
#14758
Posted: 10/22/2010 07:23:49
by Martin Hren (Basic support level)
Joined: 10/20/2010
Posts: 13

Code
                Ref1 = new TElXMLReference();
                Ref1.DigestMethod = SBXMLSec.Unit.xdmSHA1;
                [B]Ref1.URINode = FXMLDocument.GetElementByID("data");[/B]
                Ref1.URI = "#data";
                Ref1.RefType = "http://www.gzs.si/shemas/eslog/racun/1.5#Racun";

                Refs = new TElXMLReferenceList();
                Refs.Add(Ref1);


To je vsa moja koda za dodajanje referenc (pisano v C#). Si preveril, kateri element ti vrne ko nastavljaš URINode? Tukaj se moraš obvezno sklicevati na <Racun Id="data">, drugače vrne prav ta error (pravkar stestiral).

Tebi je uspelo odstraniti vse Id-je?
#14759
Posted: 10/22/2010 07:28:11
by Martin Hren (Basic support level)
Joined: 10/20/2010
Posts: 13

Vidim tudi, da imava različno glavo dokumenta. Jaz imam takšno:

Code
<?xml version="1.0" encoding="utf-8"?>
<IzdaniRacunEnostavni xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xds="http://uri.etsi.org/01903/v1.1.1#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.gzs.si/e-poslovanje/sheme/eSLOG_1-5_EnostavniRacun.xsd">
#14760
Posted: 10/22/2010 07:49:50
by Sašo Osenk (Standard support level)
Joined: 09/20/2010
Posts: 35

Glavo sem popravil, hvala, kodo mam pa,sicer v Delphiju, isto. Pa ne dela.
Code
    Ref := nil;
    Refs := TElXMLReferenceList.Create;
    Ref := TElXMLReference.Create;
    Ref.DigestMethod := xdmSHA1;
    Ref.UriNode :=FXMLDocument.GetElementByID('data');//FXMLDocument.DocumentElement;
    Ref.URI :='#data';
    Ref.RefType:='http://www.gzs.si/shemas/eslog/racun/1.5#Racun';
    Refs.Add(Ref);
    Ref:=nil;


ID-je sem odstranil v FomatElementu.

Sašo
#14761
Posted: 10/22/2010 08:06:24
by Martin Hren (Basic support level)
Joined: 10/20/2010
Posts: 13

Lahko pošlješ trenutno kodo in xml, ki ti ga zgenerira?
#14771
Posted: 10/25/2010 01:37:50
by Sašo Osenk (Standard support level)
Joined: 09/20/2010
Posts: 35

Koda in xml je v prilogi. A lahko preveriš kje je razlika v primerjavi z tvojo kodo?
Hvala.

Sašo


[ Download ]
#14773
Posted: 10/25/2010 03:45:23
by Sašo Osenk (Standard support level)
Joined: 09/20/2010
Posts: 35

It seems that I have trouble with references. Any idea what am I doing wrong?

Quote
Reference URI="#data" failed to verify
Reference URI="#SignedPropertiesId" failed to verify
Validation of <SignedInfo> failed


The xml file and code is in attachment.
Thank's for all help.

Sašo


[ Download ]
#14777
Posted: 10/25/2010 05:58:20
by Dmytro Bogatskyy (EldoS Corp.)

I have signed an xml document with your code ok (attached an xml document in zip archive). Did you do any modification to your xml document after modification?
Also, I suggest to enable new-line normalization in your code on loading xml document, it will make signature more compatible with other applications
FXMLDocument.LoadFromStream(F, '', false); // third parameter set to true


[ Download ]
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 26365 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!