This release is a pre-release and may not be stable for production use.
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.
Metadata
Release files for swarmauri_cipher_suite_jwa 0.11.0.dev2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| swarmauri_cipher_suite_jwa-0.11.0.dev2.tar.gz | 8.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| swarmauri_cipher_suite_jwa-0.11.0.dev2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.0 kB
Release files / swarmauri_cipher_suite_jwa-0.11.0.dev2.tar.gz
| Download URL | swarmauri_cipher_suite_jwa-0.11.0.dev2.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d9a797bb948264d823bcde792e9eb623f361d534bb42bdd7bd95ac55b765ac3
|
|
BLAKE2b-256 checksum How to use checksums |
1d3f71867616c7f25d6c2a3b07df3e382e9a991e2b9f480763531fc2db0acc6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / swarmauri_cipher_suite_jwa-0.11.0.dev2-py3-none-any.whl
| Download URL | swarmauri_cipher_suite_jwa-0.11.0.dev2-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ea699fd5b077215912fb568f184d0ff08fa578e5ea24ffbda50da8a6537f97c
|
|
BLAKE2b-256 checksum How to use checksums |
b10a9b17ae0daae37e2bab5d7b3735161362f95b0b19de6392195119510b7d4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|