Skip to main content

Python SDK for the Digital Evidence Depository (DED) on Constellation Network

Project description

constellation-digital-evidence-sdk

License

Python SDK for the Digital Evidence Depository on Constellation Network. Create, sign, and submit cryptographic fingerprints for document notarization.

Install

pip install constellation-digital-evidence-sdk

# With network module:
pip install constellation-digital-evidence-sdk[network]

Modules

Core (default import) — pure cryptographic operations with no network dependencies.

Network (optional extra) — async HTTP client for the Digital Evidence Ingestion API. Requires httpx.

# Core — always available
from constellation_digital_evidence_sdk import generate_fingerprint, GenerateOptions

# Network — requires [network] extra
from constellation_digital_evidence_sdk.network import DedClient, DedClientConfig

Usage

Generate a signed fingerprint

from constellation_digital_evidence_sdk import (
    generate_fingerprint,
    GenerateOptions,
    validate_submission,
)
from constellation_sdk import generate_key_pair

key_pair = generate_key_pair()

submission = generate_fingerprint(
    GenerateOptions(
        org_id="550e8400-e29b-41d4-a716-446655440000",
        tenant_id="123e4567-e89b-12d3-a456-426614174000",
        event_id="7ca8c920-0ead-22e2-91c5-11d05fe540d9",
        document_id="contract-2024-001",
        document_content="This is my document content",
        include_metadata=True,
        tags={"department": "legal"},
    ),
    key_pair.private_key,
)

validate_submission(submission)

Submit to the API

from constellation_digital_evidence_sdk.network import DedClient, DedClientConfig

async with DedClient(DedClientConfig(
    base_url="http://localhost:8081",
    api_key="your-api-key",
)) as client:
    results = await client.fingerprints.submit([submission])
    detail = await client.fingerprints.get_by_hash(hash_value)
    stats = await client.fingerprints.get_stats()

Core API

Export Description
generate_fingerprint Create, sign, and package a fingerprint in one call
create_fingerprint_value Build the fingerprint value object
sign_fingerprint Sign a fingerprint value with a private key
hash_document SHA-256 hash a document (string or bytes)
validate_submission Validate a submission
FingerprintGenerator Reusable generator with stored config
compute_metadata_hash Compute deterministic metadata hash
create_metadata Create metadata with optional tags

Signature Protocol

The SDK implements SECP256K1_RFC8785_V1:

  1. Canonicalize JSON per RFC 8785
  2. SHA-256 hash the canonical bytes
  3. Convert hash to hex string, treat as UTF-8 bytes
  4. SHA-512 hash, truncate to 32 bytes
  5. Sign with SECP256K1 ECDSA

Development

python3 -m venv .venv
.venv/bin/pip install -e ".[dev]"
.venv/bin/pytest tests/ -v

License

Apache-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

constellation_digital_evidence_sdk-0.3.0.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file constellation_digital_evidence_sdk-0.3.0.tar.gz.

File metadata

File hashes

Hashes for constellation_digital_evidence_sdk-0.3.0.tar.gz
Algorithm Hash digest
SHA256 686303b6cace426c60529e662dcd7dcde7c1a4cd73818d5dff697e0a5a7f6b64
MD5 4330b218de0a6da18a3fb4c3c8cb7468
BLAKE2b-256 61a4b166593da13116bd8cccee40758dc40174c8fcc187111cf431a7a79e7b9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for constellation_digital_evidence_sdk-0.3.0.tar.gz:

Publisher: publish-py.yml on Constellation-Labs/digital-evidence-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file constellation_digital_evidence_sdk-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for constellation_digital_evidence_sdk-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 122af4be2d85b603b4fb773a0fcbd0f22265526473d6e96b1b8f0ceda776fcb8
MD5 58ff332e8763fbff101dd807369d899e
BLAKE2b-256 7a84719acebea1c51accd71ad39ebe1e1af0ed44773e9c73a2bd978be1806cbb

See more details on using hashes here.

Provenance

The following attestation bundles were made for constellation_digital_evidence_sdk-0.3.0-py3-none-any.whl:

Publisher: publish-py.yml on Constellation-Labs/digital-evidence-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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