File-backed key provider for Swarmauri
Project description
Swarmauri File Key Provider
A file-backed key provider implementing the KeyProviderBase interface.
It manages symmetric and asymmetric keys on disk and exports public material via JWK/JWKS.
Installation
pip install swarmauri_keyprovider_file
Usage
import asyncio
from tempfile import TemporaryDirectory
from swarmauri_keyprovider_file import FileKeyProvider
from swarmauri_core.keys.types import (
ExportPolicy,
KeyAlg,
KeyClass,
KeySpec,
)
from swarmauri_core.crypto.types import KeyUse
async def run_example() -> str:
with TemporaryDirectory() as tmp:
provider = FileKeyProvider(tmp)
spec = KeySpec(
klass=KeyClass.symmetric,
alg=KeyAlg.AES256_GCM,
uses=(KeyUse.ENCRYPT,),
export_policy=ExportPolicy.SECRET_WHEN_ALLOWED,
)
created = await provider.create_key(spec)
provider2 = FileKeyProvider(tmp)
loaded = await provider2.get_key(created.kid, include_secret=True)
print(f"Loaded key: {loaded.kid}")
asyncio.run(run_example())
Entry Point
The provider registers under the swarmauri.key_providers entry point as FileKeyProvider.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file swarmauri_keyprovider_file-0.2.0.dev4.tar.gz.
File metadata
- Download URL: swarmauri_keyprovider_file-0.2.0.dev4.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bae80cfcb9d9da950970ce474c048afb05778ad3fe300c3bbcae23615f5392c
|
|
| MD5 |
331d5bc3e9228c9d47259b516e8e8e36
|
|
| BLAKE2b-256 |
4a98a507643e37e7e5d27d0990c0a9ea608a2239070f339a7e2768793f946714
|
File details
Details for the file swarmauri_keyprovider_file-0.2.0.dev4-py3-none-any.whl.
File metadata
- Download URL: swarmauri_keyprovider_file-0.2.0.dev4-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7b2b30253b769e0b220d03f83eb052227a8cc2637bc25a582c00ffb7abd7e35
|
|
| MD5 |
b8402acd11bc1d397f5a50c89b4647a5
|
|
| BLAKE2b-256 |
29aa2de6a4e92d1ade88e88ea63cc2996ded4162fbcbdf8622dde182f571f105
|