Skip to main content

JWA-focused cipher suite for Swarmauri

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_cipher_suite_jwa Discord

Swarmauri Cipher JWA

Normalization-centric cipher suite that maps JSON Web Algorithm (JWA) names into provider-friendly descriptors for Swarmauri crypto and signing implementations.

Implements the algorithm profiles defined in RFC 7518: JSON Web Algorithms (JWA).

Features

  • Centralizes JWA algorithm allow-lists for signing, encryption, and key management operations
  • Provides dialect translation helpers for COSE identifiers and provider metadata
  • Supplies sensible defaults so crypto providers can delegate algorithm selection to the suite
  • Enforces consistent tag lengths and parameter shapes for AES-GCM and RSA-PSS

Installation

pip

pip install swarmauri_cipher_suite_jwa

Poetry

poetry add swarmauri_cipher_suite_jwa

uv

To add the dependency to a pyproject.toml managed by uv:

uv add swarmauri_cipher_suite_jwa

Or install it into the active environment:

uv pip install swarmauri_cipher_suite_jwa

Usage

from swarmauri_cipher_suite_jwa import JwaCipherSuite
from swarmauri_core.crypto.types import KeyRef, KeyType, KeyUse, ExportPolicy

# Construct a key reference representative of the caller's key inventory
key = KeyRef(
    kid="demo-rsa",
    version=1,
    type=KeyType.RSA,
    uses=(KeyUse.SIGN, KeyUse.VERIFY),
    export_policy=ExportPolicy.PUBLIC_ONLY,
)

suite = JwaCipherSuite(name="default-jwa")

# Resolve the provider-facing descriptor for a signing request
descriptor = suite.normalize(op="sign", alg="PS256", key=key)
print(descriptor["mapped"]["provider"])  # -> "PS256"
print(descriptor["params"]["saltBits"])   # -> 256 (derived default)

normalize returns a structured dictionary containing the canonical algorithm, per-dialect aliases, policy constraints, and defaulted parameters. Crypto and signing providers consume this descriptor to select the correct primitives without re-implementing JWA policy logic.

Entry Point

The suite registers under the swarmauri.cipher_suites entry point as JwaCipherSuite.

Want to help?

If you want to contribute to swarmauri-sdk, read up on our guidelines for contributing that will help you get started.

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_cipher_suite_jwa-0.11.0.dev1.tar.gz (8.0 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_cipher_suite_jwa-0.11.0.dev1.tar.gz.

File metadata

  • Download URL: swarmauri_cipher_suite_jwa-0.11.0.dev1.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for swarmauri_cipher_suite_jwa-0.11.0.dev1.tar.gz
Algorithm Hash digest
SHA256 e2171f6640a1e52315d85befcb289db457c2722f77f77202219e08ea643c3c4a
MD5 ae945f43d0ef60ff208aa9c2df658fc3
BLAKE2b-256 78363f7b8971e329a1dbcb51aa92e1425f1e6d2dcec6eaeb601da498ea7c27a9

See more details on using hashes here.

File details

Details for the file swarmauri_cipher_suite_jwa-0.11.0.dev1-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_cipher_suite_jwa-0.11.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for swarmauri_cipher_suite_jwa-0.11.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 cac3303ec7a942a600f9e8e6c9de8a8f961274c97f6a0bef990a1e7c32b80d21
MD5 d2b3717b9184ce7f87618f7232091fe8
BLAKE2b-256 90fb49019c8fa4f06a5150fed5937a751b2b3e872b6fc029c5f77c27e1cc6d85

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