Metadata-Version: 2.4
Name: tmautils-pki
Version: 0.2.0
Summary: PKI/certificate utilities for tmautils
License-Expression: MPL-2.0
License-File: LICENSE
Author: Sulyab Thottungal Valapu
Author-email: sulyabtv@gmail.com
Requires-Python: >=3.13,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Provides-Extra: dev
Requires-Dist: certifi (>=2025.11.12,<2026.0.0)
Requires-Dist: cryptography (>=46.0.0,<47.0.0)
Requires-Dist: pytest (>=9.0.0,<10.0.0) ; extra == "dev"
Requires-Dist: pytest-asyncio (>=1.0.0,<2.0.0) ; extra == "dev"
Requires-Dist: tmautils-core (>=0.2.0,<0.3.0)
Project-URL: Repository, https://github.com/sulyabtv/tmautils-pki
Description-Content-Type: text/markdown

# tmautils-pki
PKI/certificate utilities for Internet measurement research. Part of the [tmautils](https://github.com/sulyabtv/tmautils) package family.

Installation:
```bash
pip install tmautils-pki
```

## API

| Utility / Function | What it does |
| --- | --- |
| `RevocationChecker` | Check certificate revocation (OCSP/CRL) |
| `create_ssl_context()` | Create configurable SSL context |
| `get_cert()` | Fetch TLS certificate from a server |
| `get_cert_chain()` | Fetch full certificate chain from a server |
| `fetch_issuer_cert()` | Fetch issuer certificate via AIA extension |
| `fetch_issuer_chain()` | Build certificate chain from leaf to root |

## Acknowledgments
Revocation checking logic (OCSP/CRL) adapts code from [pki-tools](https://github.com/fulder/pki-tools) by Michal Sadowski, licensed under the MIT License.

## License
This project is licensed under [MPL-2.0](LICENSE) (Mozilla Public License 2.0).

What this means in practice:
- If you modify an existing file, your modifications must remain MPL-2.0.
- You can license new files however you want. (But I won't merge them unless they are MPL-2.0.)
- You can use this code alongside code under other licenses.

## Contributing
Contributions are highly welcome! See the [tmautils README](https://github.com/sulyabtv/tmautils/blob/main/README.md) for philosophy and design choices.

AI Policy: I don't consider AI tool usage any different from IDE usage. This also means that *you* are responsible for the code you write and *you* should inspect every line of code written by an LLM.

