Error s004 - Incorrect digital signature with XMLDsig in Java

Dec 5, 2012 at 12:57 PM


I am a Software Engineer from Micros-Retail Austria and currently developing the Croatian Fiskal Project for one of our customers. I implement it in Java and until now it was not a big deal and rather straight forward.
But now it's up to the signation of the XML request files. For this I use the Apache Santuario library and it seems to produce correct output, but I stil ran into an Errocode 004 - Incorrect digital signature response from the fiskal-testsystem.

I have read about the certificate- and signing-stuff on this side and discovered that there are 4 different certificates instead of two - like described in the specification.
So I believe now that I use the wrong certificate for signing. I have only two: the democa.cert and the FINA Demo application certificate (.pfx format). I am able to establish the SSL connection by importing the democa.cert in a truststore and both of them in a keystore. But I have no idea now, what certificate I need for proper signing the requests.

Have anyone already implemented the whole procedure with correct response? Or do you know which certificate I need for signing and where to get it?

Best regards,

Dec 5, 2012 at 1:05 PM

For signing purposes you must use FISKAL ("FISKAL 1") demo certificate.

Probably hundreds of people has already implemented signing and sending XML to the CIS :)

Dec 5, 2012 at 1:09 PM

Thank you for the information. Where can I get the FISKAL 1 certificate?

Dec 5, 2012 at 1:09 PM
nrasinec wrote:

Probably hundreds of people has already implemented signing and sending XML to the CIS :)

  Would be nice if some of them could help... ;)

Dec 5, 2012 at 1:10 PM

You can get demo FISKAL ("FISKAL 1") certificate from FINA

Dec 5, 2012 at 1:13 PM

Thanks a lot!