Composable DSSE envelope adapter that layers Pre-Authentication Encoding onto Swarmauri signing providers
Project description
Swarmauri Signing DSSE
DSSESigner layers the in-toto DSSE envelope format on top of any existing Swarmauri
signer. It computes the Pre-Authentication Encoding (PAE) defined by the spec, delegates raw signing and verification to the
wrapped provider, and exposes helpers for serializing envelopes in the DSSE JSON representation.
Features
- Adds the
dsse-paecanonicalization surface to anySigningBaseprovider. - Supports detached signature workflows for bytes, digests, streams, and envelopes.
- Includes a strict JSON codec with typed helpers for building and inspecting DSSE envelopes.
- Maintains the inner signer's capability matrix while declaring DSSE-specific features (
detached_only,multi).
Installation
Install the package with your preferred Python packaging tool:
Using uv
uv add swarmauri_signing_dsse
Using pip
pip install swarmauri_signing_dsse
Usage
import base64
from swarmauri_signing_dsse import DSSESigner, DSSEEnvelope
from swarmauri_signing_ed25519 import Ed25519EnvelopeSigner
# Wrap an existing Swarmauri signer.
inner_signer = Ed25519EnvelopeSigner()
dsse_signer = DSSESigner(inner_signer)
# Prepare a DSSE envelope.
payload = b"example payload"
payload_b64 = base64.urlsafe_b64encode(payload).decode("ascii").rstrip("=")
envelope = DSSEEnvelope(payload_type="text/plain", payload_b64=payload_b64)
# Sign and verify using DSSE PAE over the payload.
key_ref = {"kind": "raw_ed25519_sk", "bytes": b"\x01" * 32}
signatures = await dsse_signer.sign_envelope(key_ref, envelope)
assert await dsse_signer.verify_envelope(envelope, signatures)
DSSESigner accepts existing DSSE JSON mappings or bytes anywhere an envelope is expected. The helper methods
encode_envelope() and decode_envelope() let you round-trip envelopes without reimplementing JSON handling.
License
This project is licensed under the Apache License 2.0.
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_signing_dsse-0.1.3.dev18.tar.gz.
File metadata
- Download URL: swarmauri_signing_dsse-0.1.3.dev18.tar.gz
- Upload date:
- Size: 9.7 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 |
265482817d66e4e3295a95ac605b062348a1e139ab488d56917bbc0bbccfbe10
|
|
| MD5 |
4bc578a2f65611652ad39d6995f8ed73
|
|
| BLAKE2b-256 |
8bb339114fe8fe70da5806c94a985f9956a840447559ed69d32c3bce23b8b93a
|
File details
Details for the file swarmauri_signing_dsse-0.1.3.dev18-py3-none-any.whl.
File metadata
- Download URL: swarmauri_signing_dsse-0.1.3.dev18-py3-none-any.whl
- Upload date:
- Size: 11.5 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 |
006e6c4a3fb595b982345b7e878430263017004fab9577ccd3c63f25541a77dc
|
|
| MD5 |
8f309bff3ebe73dc7658f0cf86035e37
|
|
| BLAKE2b-256 |
15c6a9764a7af9510ef03e1a884bb73e11c4e8cd2d63631d52c1be8d382b6d6f
|