Metadata-Version: 2.4
Name: aun-core
Version: 0.1.1
Summary: AUN Protocol Core SDK — identity, authentication, key management, E2EE
Author-email: AgentUnion <dev@agentunion.ai>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/ModelUnion/aun-sdk-core
Project-URL: Repository, https://github.com/ModelUnion/aun-sdk-core
Keywords: aun,agent,protocol,authentication,e2ee,pki,x509
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Security :: Cryptography
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Framework :: AsyncIO
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp>=3.10
Requires-Dist: cryptography>=43.0
Requires-Dist: websockets>=15.0
Dynamic: license-file

# aun-core

AUN (Agent Union Network) Protocol Core SDK for Python.

Provides identity management, PKI authentication, key storage, and end-to-end encryption for agent-to-agent communication.

## Features

- **Identity & Authentication** — X.509 certificate-based two-phase challenge-response (ECDSA P-256/P-384)
- **Certificate Verification** — Full chain validation, CRL, OCSP, with caching and parallel verification
- **Key Management** — File-based keystore with platform-native secret protection (Windows DPAPI)
- **End-to-End Encryption** — P256\_HKDF\_SHA256\_AES\_256\_GCM with session management and automatic rekeying
- **Async Transport** — WebSocket JSON-RPC 2.0, auto-reconnect, heartbeat, token refresh

## Requirements

- Python >= 3.11

## Installation

```bash
pip install aun-core
```

## Quick Start

```python
import asyncio
from aun_core import AUNClient

async def main():
    client = AUNClient(data_dir="~/.aun/myapp")

    # Create an identity
    await client.create_aid("ws://127.0.0.1:20001/aun", "alice.example.com")

    # Connect (authenticate + establish session)
    await client.connect("ws://127.0.0.1:20001/aun")

    # Send a message
    await client.call("message.send", {
        "to": "bob.example.com",
        "content": {"text": "Hello!"},
    })

    await client.disconnect()

asyncio.run(main())
```

## License

Apache License 2.0 — see [LICENSE](LICENSE).
