I have this scenario.
I have an application that generates a PDF, and that needs to be signed.
We have not the certificates to sign the document, because the
After much debugging, we finally found the problem.
For some mysterious reason, the method that generates the hash of the document, was executed twice, invalidating the first hash (which we use to send to the service).
After a refactoring work of the code, the original code worked correctly.
Very thanks to all people that help me, especially mkl.