Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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.

Opt-in X448 key agreement

from swarmauri_cipher_suite_jwa import JwaCipherSuite

suite = JwaCipherSuite(enable_x448=True)
agreement = suite.normalize(
    op="key_agreement",
    alg="ECDH-ES",
    key={"kty": "OKP", "crv": "X448"},
    params={"enc": "A256GCM"},
)

The suite validates the selection. Use JweCrypto(enable_x448=True) from swarmauri-crypto-jwe to perform compact JWE encryption or decryption.

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.

Metadata

Release files for swarmauri_cipher_suite_jwa 0.11.0.dev4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for swarmauri_cipher_suite_jwa 0.11.0.dev4
File Size Uploaded Provenance Actions
swarmauri_cipher_suite_jwa-0.11.0.dev4.tar.gz 8.4 kB Without provenance Details for swarmauri_cipher_suite_jwa-0.11.0.dev4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for swarmauri_cipher_suite_jwa 0.11.0.dev4
File Interpreter ABI Platform Actions
swarmauri_cipher_suite_jwa-0.11.0.dev4-py3-none-any.whl Python 3 none any Details for swarmauri_cipher_suite_jwa-0.11.0.dev4-py3-none-any.whl

Total release size: 17.9 kB

Release files / swarmauri_cipher_suite_jwa-0.11.0.dev4.tar.gz

Download URL swarmauri_cipher_suite_jwa-0.11.0.dev4.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4fc542ea816b4ac647e9af60a6de8ece32797fe6e8cfd967dc8be96d801362a5
BLAKE2b-256 checksum
How to use checksums
1f81103e903aaa149deed13aa54b551d4fa0129d7987e2eccf99b83d552c11ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / swarmauri_cipher_suite_jwa-0.11.0.dev4-py3-none-any.whl

Download URL swarmauri_cipher_suite_jwa-0.11.0.dev4-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e7171cd524a81cbc0077449246fd19d0f786caedc75663d3720e0f139a92546
BLAKE2b-256 checksum
How to use checksums
d5c9298f53a6de273b6e0296b28e40fbbde85229bc7b49a703eb7102823d016d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for swarmauri_cipher_suite_jwa 0.11.0.dev4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page