Unable to build a validation path for the certificate #45
-
Hello Matthias, During handling of the above exception, another exception occurred: Traceback (most recent call last): |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
Well, the error message means just that: the validator can't find a suitable certificate for the issuer of your signing cert :) Since you didn't pass in any trust configuration options on the command line, pyHanko only has access to whatever's in your system trust. The certificates you need may not be in there, so you'll have to fetch them from somewhere else. The CA's website would be a good place to start looking. It's also possible that your signer's certificate tells you where you can download the issuer cert, this is not something that happens automatically right now. Once you have the required certificates, you'll also need to make sure that the relevant root certificate is trusted. See here and here for information on how to do that. Also: there's no actual time stamping service hosted at tsa.example.com, that's just a placeholder URL ;). That said, there are many (widely trusted) TSAs out there that expose a time stamping service to the general public. Someone put together a list here (but I can't vouch for its accuracy). |
Beta Was this translation helpful? Give feedback.
-
Matthias thanks for your reply, this code has successfully generated a pdf output but if i add --with-validation-info dany@papa:~/sign$ /home/dany/.local/bin/pyhanko sign addsig \
2021-07-31 12:37:05,334 - pyhanko.cli - ERROR - Error raised while producing signed file. During handling of the above exception, another exception occurred: Traceback (most recent call last): |
Beta Was this translation helpful? Give feedback.
-
Yes, that's still the same issue. The root cert for
is not being found. It's probably just not available in your system trust. You'll want to add that Root CA cert to pyHanko's trust store, otherwise there's no path to validate, and no validation info to be included in the PDF file). My previous comment has a link to the relevant section in the documentation for how to do that. As for where to find the root certificate, a Google search got me here: https://repository.govca.id/WaOnEmperoR/pdfverification/-/tree/79e9275a6cf7875fd9f5948c30acae413b4946e0/src/main/resources/static/certs. |
Beta Was this translation helpful? Give feedback.
-
thanks |
Beta Was this translation helpful? Give feedback.
-
Hello Matthias, I have a new problem here But document has been corrupted pyhanko.cfg stamp-styles: validation-contexts: dany@papa:~/sign$ /home/dany/.local/bin/pyhanko --verbose --config pyhanko.cfg sign addsig \
|
Beta Was this translation helpful? Give feedback.
-
Hi, This looks like it could be a bug, but I can't reproduce the behaviour you're seeing with my own test PDFs. Could you send both the input and output PDF to pyhanko.samples@mvalvekens.be, please? Chances are that this is a quirk in the input file's form structure that isn't being processed correctly, but either way I need to see the input and output PDFs to figure out what's happening. Also, could you try signing this test file and see if the problem persists? The signature field is named |
Beta Was this translation helpful? Give feedback.
-
Hello Matthias, I have sent an email to pyhanko.samples@mvalvekens.be |
Beta Was this translation helpful? Give feedback.
Well, the error message means just that: the validator can't find a suitable certificate for the issuer of your signing cert :)
Since you didn't pass in any trust configuration options on the command line, pyHanko only has access to whatever's in your system trust. The certificates you need may not be in there, so you'll have to fetch them from somewhere else. The CA's website would be a good place to start looking. It's also possible that your signer's certificate tells you where you can download the issuer cert, this is not something that happens automatically right now.
Once you have the required certificates, you'll also need to make sure that the relevant root certificate is trusted.…