pyhanko.sign.validation.status - WARNING - The path could not be validated because the end-entity certificate expired 2022-05-25 04:17:25Z #129
-
Hello, we try to validate a pdf-document from a bank which signer we basically trust by trusting D-TRUST_Root_CA_3_2016.crt. But the signers certificate was already expired in the moment of validation. Because of the expiration the validation will fail:
If we had validate this document 2 months before the validation would be successful. Is there any Option for pyhanko (CLI or python) that tells pyhanko to validate the document no matter of date certificate expiredate? I cannot find anything in the docs that helps or may be don't understand it. Best Regards, Thomas |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @thomasgundlach, This is a common issue in document signing, and common practice dictates that, if possible, one should attempt to ascertain the validity of the certificate at the time the signature was produced. The catch is that to allow that to be done more or less securely, the signer needs to supply a whole lot of additional data to ensure that (a) there's a proper record of the signature's existence at (or close to) the claimed time of signing, witnessed by a trusted time stamping authority, and Long story short, (a) is necessary because you generally can't trust signers to accurately report the time of signing themselves (that would allow backdating signatures, for example), and (b) is necessary because CAs can't be relied on to supply historical revocation info, especially not w.r.t. expired certificates. While pyHanko's handling of point-in-time validation is still quite rough around the edges (as indicated on the known issues page), this document is a good example of someone Doing It Wrong™: the time of signing is an untrusted assertion (=unverifiable) and judging from the weird expiration timestamps, the signing service uses short-lived certificates, which pretty much require securely timestamped signatures to work in any reasonable trust model. To put it bluntly: given only this information, there's no way to distinguish between a valid signed document for which the signer's certificate happens to have expired, and a signature created with a (compromised?) key that was backdated to the original certificate's validity window. You might as well forget about all the expiration dates, then. Anyway, assuming you don't care about any of that, there's a way to make all of that work by taking the time of signing at face value. That requires two things:
Everything else follows the usual procedures for validation. None of this is exposed in the CLI at this point, though. Would that help? Or are you happy with a Python-based solution? |
Beta Was this translation helpful? Give feedback.
Hi @thomasgundlach,
This is a common issue in document signing, and common practice dictates that, if possible, one should attempt to ascertain the validity of the certificate at the time the signature was produced. The catch is that to allow that to be done more or less securely, the signer needs to supply a whole lot of additional data to ensure that
(a) there's a proper record of the signature's existence at (or close to) the claimed time of signing, witnessed by a trusted time stamping authority, and
(b) the revocation status of the certificate at that time can be checked.
Long story short, (a) is necessary because you generally can't trust signers to accurately report the time of sig…