Metadata-Version: 2.4
Name: pydigidoc
Version: 0.0.3
Summary: Python bindings for libdigidocpp - create, validate and handle digitally signed documents
Keywords: digidoc,digital-signature,xades,asice,bdoc,estonia,id-card,libdigidocpp
Author-Email: Lenno Nagel <lenno@namespace.ee>
License-Expression: LGPL-2.1-or-later
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: C++
Classifier: Topic :: Security :: Cryptography
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Project-URL: Homepage, https://github.com/namespace-ee/pydigidoc
Project-URL: Repository, https://github.com/namespace-ee/pydigidoc
Project-URL: Issues, https://github.com/namespace-ee/pydigidoc/issues
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# pydigidoc

Python bindings for [libdigidocpp](https://github.com/open-eid/libdigidocpp) — create, validate and handle digitally signed documents (ASiC-E, BDOC, etc).

## Installation

```bash
pip install pydigidoc
```

## Usage

```python
import pydigidoc

# Initialize the library
pydigidoc.initialize("MyApp")

# Create a container and add files
doc = pydigidoc.Container.create("document.asice")
doc.add_data_file("report.pdf", "application/pdf")

# Sign with a PKCS#12 certificate
signer = pydigidoc.PKCS12Signer("certificate.p12", "password")
doc.sign(signer)
doc.save()

# Open and verify an existing container
doc = pydigidoc.Container.open("document.asice")
for sig in doc.signatures():
    print(f"Signed by: {sig.signed_by()}")
    sig.validate()

# Clean up
pydigidoc.terminate()
```

## Building from source

### Prerequisites

- Python 3.10+
- CMake 3.20+
- SWIG 4.0+
- C++23 compiler (GCC 13+, Clang 16+, MSVC 2022+)
- OpenSSL 3.0+, libxml2, zlib, xmlsec1

### Build

```bash
git clone --recurse-submodules https://github.com/namespace-ee/pydigidoc.git
cd pydigidoc
pip install .
```

## License

LGPL-2.1-or-later. See [LICENSE](LICENSE) for the full text and [RELINKING.md](RELINKING.md) for relinking instructions.
