File system certificate store.
| 98 | |
| 99 | |
| 100 | class FSCertStore(CertStore): |
| 101 | """File system certificate store.""" |
| 102 | |
| 103 | def __init__(self, path: str) -> None: |
| 104 | super().__init__() |
| 105 | if os.path.isdir(path): |
| 106 | path = os.path.join(path, '*') |
| 107 | for p in glob.glob(path): |
| 108 | with open(p) as f: |
| 109 | cert = Certificate(f.read()) |
| 110 | if cert.has_expired(): |
| 111 | raise SecurityError( |
| 112 | f'Expired certificate: {cert.get_id()!r}') |
| 113 | self.add_cert(cert) |
no outgoing calls