Skip to main content

In-memory key provider for development and testing

Project description

Swamauri Logo

Swarmauri Local Key Provider

Provides a simple in-memory key provider for development and testing.

Installation

pip install swarmauri_keyprovider_local

Usage

import asyncio
from swarmauri_keyprovider_local import LocalKeyProvider
from swarmauri_core.keys.types import (
    ExportPolicy,
    KeyAlg,
    KeyClass,
    KeySpec,
)
from swarmauri_core.crypto.types import KeyUse


async def run_example() -> str:
    provider = LocalKeyProvider()
    spec = KeySpec(
        klass=KeyClass.symmetric,
        alg=KeyAlg.AES256_GCM,
        uses=(KeyUse.ENCRYPT,),
        export_policy=ExportPolicy.SECRET_WHEN_ALLOWED,
    )
    created = await provider.create_key(spec)
    fetched = await provider.get_key(created.kid, include_secret=True)
    print(f"Retrieved key: {fetched.kid}")


asyncio.run(run_example())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swarmauri_keyprovider_local-0.2.0.dev2.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file swarmauri_keyprovider_local-0.2.0.dev2.tar.gz.

File metadata

File hashes

Hashes for swarmauri_keyprovider_local-0.2.0.dev2.tar.gz
Algorithm Hash digest
SHA256 e2699cbeb4480cdd81ddfeb338a2baf0cb9433b95edc9163e8a585e121db2d64
MD5 abb5b1df1b5f1c33f82eaf611345d4a4
BLAKE2b-256 91ce9f60f669d8519103c9ac090735299adbbd4a0d8eb45d4c2d28709a282da0

See more details on using hashes here.

File details

Details for the file swarmauri_keyprovider_local-0.2.0.dev2-py3-none-any.whl.

File metadata

File hashes

Hashes for swarmauri_keyprovider_local-0.2.0.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 09d8878262eedbee451a2a76b9ccb82ddbbc769d7533a207894c30c48abba845
MD5 4c67388283bddb3b1c3db5ec535f427f
BLAKE2b-256 80f2abd67e89ff2829d55c223c866493d1c5adfaf1d644330c9aa38783982c5e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page