Validation with all trusted root certificates #427
-
Hello friends, I'm trying to understand how validation is supposed to work. In the examples it seems to want to read a root certificate from a file like The thing is that this will only work if I know a priori the root certifiactes that I trust. How could I validate with all certificates thata re universally trusted (i.e by my operating system)? For example, in Adobe Acrobat you don't need to define which root certificates to trust, it just knows which are trusted (I guess by the operating system). Is there a way for me to achive a similar functionaltiy with pyhanko validation? This way of using the validation functionality seems too obvious to me unless I don't understand or miss something :| Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hey friends, I didn't get any answers on that. Is what I'm asking viable? Can it be done somehow ? |
Beta Was this translation helpful? Give feedback.
Hi @spapas, that's the default behaviour if you don't specify
trust_roots
;).This is documented in the docstring for
ValidationContext.__init__
, but apparently that is not picked up by the documentation generator. I should do something about that (holdover fromcertvalidator
prior to me forking it, so I didn't notice).Background notes: Fetching/describing the system trust is of course a very platform-dependent operation. In the background, pyHanko uses
oscrypto
to abstract that away, but beware that depending on what kind of validation you are performing, the system trust could contain a bunch of certs that you don't actually want to trust for document signing purposes--most of those ro…