Problem with verification of xades signature

Hi!

  1. I generated a SelfSigned certificate using X509CertificateGenerator.exe
  2. I signed the xml document using the code:

XAdES := TXAdES.Create ;

try
XAdES.KeyFilePath := '.\Cert\mykey3.key' ;
XAdES.CertFilePath := '.\Cert\mycert3.crt' ;
XAdES.PathToOriginalFile := '.\Inp' ;
XAdES.Packaging := enveloped ;

XAdES.GenerateSignature('.\Inp\Invoice.xml', '.\Out\Invoice.xml.xades') ;

Finally
XAdES.Free ;
end ; { try .. finally}

  1. I then tried to verify the signature with a code:

XAdES := TXAdES.Create ;

try
XAdES.PathToOriginalFile := '.' ;

VerCode := XAdES.VerifySignature('.\Out\Invoice.xml.xades') ;

VerText := XAdES.VerifyError(VerCode) ;

if VerCode < 0 then
  ErrText := XAdES.ErrorDetails ;

Finally
XAdES.Free;
end ; { try .. finally }

  1. Verification results in the following error
    .
    ]

Hi Andrzej,
Can you send me the project file, the certificate and private key by email? And the XML file too.

Issue: index in verification function pointing on the wrong XML node in the signed file, then not recognizing the signature block.
Fixed in 5.0.9.1