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.dev3.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.dev3.tar.gz.

File metadata

File hashes

Hashes for swarmauri_keyprovider_local-0.2.0.dev3.tar.gz
Algorithm Hash digest
SHA256 3e809fcc201ecfd5a4827781fec7047ee9ad8f4dbfa942820ad9bbd609b8c70b
MD5 804b34dcb227bc3bace07804651303cd
BLAKE2b-256 11e6b99ac718e0d1d3d423efda65f78bb8cf6e5f82c77a24a48adbd49247113a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for swarmauri_keyprovider_local-0.2.0.dev3-py3-none-any.whl
Algorithm Hash digest
SHA256 f4a94b7157aa5054630f2f4e06f36e569e296dc5da0e78ce49a5d557c4c53ce4
MD5 7c9acf439e703d30d2c767bb7806c1fd
BLAKE2b-256 98dee457c24fb801bd5c255bf1a622b98f8f77259de26865a8b38faaafd78b1f

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