JWA-focused cipher suite for Swarmauri
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file swarmauri_cipher_suite_jwa-0.1.0.dev38.tar.gz.
File metadata
- Download URL: swarmauri_cipher_suite_jwa-0.1.0.dev38.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47d7ee4d969be1bb2d0e0cb23d44471b15aeb09292f29550e50fa86e2c772933
|
|
| MD5 |
77b27aae79a265d1b9fb18499f4e8c27
|
|
| BLAKE2b-256 |
b6f2c9cc2087d77d1e870c7a858307a65d9a2481cc23965622427dbe86f14e43
|
File details
Details for the file swarmauri_cipher_suite_jwa-0.1.0.dev38-py3-none-any.whl.
File metadata
- Download URL: swarmauri_cipher_suite_jwa-0.1.0.dev38-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f01725186c1b58ef69f8d05bced80c5f94832480fd76512ac3a688a433f3073
|
|
| MD5 |
6ed736d38b3e8b8dfc98dbaef8d39b20
|
|
| BLAKE2b-256 |
334805f277608cc53ab7ece4b74cabde442a0aad82fb1dc1b02b4a105fedc719
|