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.1.tar.gz (13.4 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.1.tar.gz.

File metadata

File hashes

Hashes for constellation_digital_evidence_sdk-0.3.1.tar.gz
Algorithm Hash digest
SHA256 670a08ad5806087cb798f3c82261555a8961c5b5ab4913458386d3ceb5d3225d
MD5 2d3a19693956b757db806242d772e1a9
BLAKE2b-256 190f9b0f2c082f17b047e4dfa263b38a88a75116d32e8d76fa9f0fee40598977

See more details on using hashes here.

Provenance

The following attestation bundles were made for constellation_digital_evidence_sdk-0.3.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for constellation_digital_evidence_sdk-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c5e0008129106d8074cd5142aa5d86bf084cab665c44c94d7060329bb0bfb0c5
MD5 a1cbef2d7dd1e4b5ee363ef314ba8f87
BLAKE2b-256 393c65cc9cb9a2695c85ee222ad80371348946c6f130d81289b10d324a79ff1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for constellation_digital_evidence_sdk-0.3.1-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