Skip to main content

Composable DSSE envelope adapter that layers Pre-Authentication Encoding onto Swarmauri signing providers

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_signing_dsse

---

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-pae canonicalization surface to any SigningBase provider.
  • 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swarmauri_signing_dsse-0.2.1.dev2.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

swarmauri_signing_dsse-0.2.1.dev2-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file swarmauri_signing_dsse-0.2.1.dev2.tar.gz.

File metadata

  • Download URL: swarmauri_signing_dsse-0.2.1.dev2.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","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_signing_dsse-0.2.1.dev2.tar.gz
Algorithm Hash digest
SHA256 17c8cae334328788d0f304a5c58601a6f97ec608f2c0c26823054aef2f704447
MD5 62d9bc0480eae85293dffddcf8984357
BLAKE2b-256 8131fac3b08709b089cbf6d0c971e25c93b7a8e69400d6bb50e4e9c1e333f76c

See more details on using hashes here.

File details

Details for the file swarmauri_signing_dsse-0.2.1.dev2-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_signing_dsse-0.2.1.dev2-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","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_signing_dsse-0.2.1.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 0df6aa582ecc07b7100c1ff124f010d68f784f1d0f77ba7047e158acfdcfaa66
MD5 1ebdb7613adc7f95ce25e81edab8c386
BLAKE2b-256 1028217fb66375882afe1531b549020165f3fd28edfe3784fa83e2f07c2da97b

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