certcrypt-sdk 0.0.0__tar.gz → 1.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. certcrypt_sdk-1.0.1/.github/CODEOWNERS +12 -0
  2. certcrypt_sdk-1.0.1/.github/workflows/ci.yml +106 -0
  3. certcrypt_sdk-1.0.1/.gitignore +88 -0
  4. certcrypt_sdk-1.0.1/AGENTS.md +13 -0
  5. certcrypt_sdk-1.0.1/CHANGELOG.md +66 -0
  6. certcrypt_sdk-1.0.1/LICENSE +178 -0
  7. certcrypt_sdk-1.0.1/PKG-INFO +446 -0
  8. certcrypt_sdk-1.0.1/README.md +419 -0
  9. certcrypt_sdk-1.0.1/SECURITY.md +55 -0
  10. certcrypt_sdk-1.0.1/pyproject.toml +68 -0
  11. certcrypt_sdk-1.0.1/src/certcrypt/__init__.py +263 -0
  12. certcrypt_sdk-1.0.1/src/certcrypt/artifacts/__init__.py +15 -0
  13. certcrypt_sdk-1.0.1/src/certcrypt/artifacts/base_certificate.py +505 -0
  14. certcrypt_sdk-1.0.1/src/certcrypt/artifacts/capacity_evidence.py +224 -0
  15. certcrypt_sdk-1.0.1/src/certcrypt/artifacts/commitment_inclusion.py +108 -0
  16. certcrypt_sdk-1.0.1/src/certcrypt/artifacts/holder_keyset.py +162 -0
  17. certcrypt_sdk-1.0.1/src/certcrypt/artifacts/rfc3339.py +69 -0
  18. certcrypt_sdk-1.0.1/src/certcrypt/client.py +1437 -0
  19. certcrypt_sdk-1.0.1/src/certcrypt/crypto/__init__.py +15 -0
  20. certcrypt_sdk-1.0.1/src/certcrypt/crypto/ai_decision.py +171 -0
  21. certcrypt_sdk-1.0.1/src/certcrypt/crypto/canonical_subject.py +242 -0
  22. certcrypt_sdk-1.0.1/src/certcrypt/crypto/collection_merkle.py +191 -0
  23. certcrypt_sdk-1.0.1/src/certcrypt/crypto/composite.py +110 -0
  24. certcrypt_sdk-1.0.1/src/certcrypt/crypto/digest.py +43 -0
  25. certcrypt_sdk-1.0.1/src/certcrypt/crypto/ecdsa_p256.py +218 -0
  26. certcrypt_sdk-1.0.1/src/certcrypt/crypto/jcs.py +146 -0
  27. certcrypt_sdk-1.0.1/src/certcrypt/crypto/merkle.py +155 -0
  28. certcrypt_sdk-1.0.1/src/certcrypt/crypto/ml_dsa.py +74 -0
  29. certcrypt_sdk-1.0.1/src/certcrypt/crypto/pseudonym.py +61 -0
  30. certcrypt_sdk-1.0.1/src/certcrypt/crypto/strict_json.py +60 -0
  31. certcrypt_sdk-1.0.1/src/certcrypt/crypto/subject_json_preconditions.py +395 -0
  32. certcrypt_sdk-1.0.1/src/certcrypt/issuer.py +1366 -0
  33. certcrypt_sdk-1.0.1/src/certcrypt/py.typed +0 -0
  34. certcrypt_sdk-1.0.1/src/certcrypt/retry.py +184 -0
  35. certcrypt_sdk-1.0.1/src/certcrypt/types.py +475 -0
  36. certcrypt_sdk-1.0.1/tests/__init__.py +0 -0
  37. certcrypt_sdk-1.0.1/tests/conftest.py +95 -0
  38. certcrypt_sdk-1.0.1/tests/test_activation_contract.py +522 -0
  39. certcrypt_sdk-1.0.1/tests/test_ai_decision_builder.py +96 -0
  40. certcrypt_sdk-1.0.1/tests/test_ai_decision_precondition.py +206 -0
  41. certcrypt_sdk-1.0.1/tests/test_artifact_shape_conformance.py +187 -0
  42. certcrypt_sdk-1.0.1/tests/test_base_certificate.py +387 -0
  43. certcrypt_sdk-1.0.1/tests/test_canonical_subject.py +143 -0
  44. certcrypt_sdk-1.0.1/tests/test_client.py +793 -0
  45. certcrypt_sdk-1.0.1/tests/test_client_issuer_auth.py +90 -0
  46. certcrypt_sdk-1.0.1/tests/test_client_retry.py +211 -0
  47. certcrypt_sdk-1.0.1/tests/test_client_transport.py +230 -0
  48. certcrypt_sdk-1.0.1/tests/test_client_wait.py +337 -0
  49. certcrypt_sdk-1.0.1/tests/test_collection_merkle.py +188 -0
  50. certcrypt_sdk-1.0.1/tests/test_composite.py +184 -0
  51. certcrypt_sdk-1.0.1/tests/test_composite_conformance.py +95 -0
  52. certcrypt_sdk-1.0.1/tests/test_conformance_contract.py +93 -0
  53. certcrypt_sdk-1.0.1/tests/test_conformance_coverage.py +141 -0
  54. certcrypt_sdk-1.0.1/tests/test_context_snapshot_certificate.py +118 -0
  55. certcrypt_sdk-1.0.1/tests/test_context_snapshot_conformance.py +106 -0
  56. certcrypt_sdk-1.0.1/tests/test_digest.py +103 -0
  57. certcrypt_sdk-1.0.1/tests/test_ecdsa_p256_deterministic_conformance.py +123 -0
  58. certcrypt_sdk-1.0.1/tests/test_emission_recovery.py +172 -0
  59. certcrypt_sdk-1.0.1/tests/test_evidence_and_inclusion.py +274 -0
  60. certcrypt_sdk-1.0.1/tests/test_issuer.py +704 -0
  61. certcrypt_sdk-1.0.1/tests/test_issuer_guards.py +173 -0
  62. certcrypt_sdk-1.0.1/tests/test_issuer_key_derivation_conformance.py +112 -0
  63. certcrypt_sdk-1.0.1/tests/test_issuer_read_chain.py +252 -0
  64. certcrypt_sdk-1.0.1/tests/test_issuer_resolution.py +281 -0
  65. certcrypt_sdk-1.0.1/tests/test_jcs.py +94 -0
  66. certcrypt_sdk-1.0.1/tests/test_key_derivation_conformance.py +118 -0
  67. certcrypt_sdk-1.0.1/tests/test_prepare_submit.py +343 -0
  68. certcrypt_sdk-1.0.1/tests/test_pseudonym_and_keyset.py +227 -0
  69. certcrypt_sdk-1.0.1/tests/test_public_surface.py +94 -0
  70. certcrypt_sdk-1.0.1/tests/test_retry.py +52 -0
  71. certcrypt_sdk-1.0.1/tests/test_strict_json_conformance.py +75 -0
  72. certcrypt_sdk-1.0.1/tests/vectors/jcs-verifier-parity.json +3426 -0
  73. certcrypt_sdk-1.0.1/verification/2026-11-24T1815Z/collection.json +297 -0
  74. certcrypt_sdk-1.0.1/verification/2026-11-24T1815Z/system-foundation.json +110 -0
  75. certcrypt_sdk-1.0.1/verification/2026-11-24T1815Z/verification-package.json +550 -0
  76. certcrypt_sdk-1.0.1/verification/2026-11-27T0105Z/collection.json +29 -0
  77. certcrypt_sdk-1.0.1/verification/2026-11-27T0105Z/system-foundation.json +110 -0
  78. certcrypt_sdk-1.0.1/verification/2026-11-27T0105Z/verification-package.json +278 -0
  79. certcrypt_sdk-1.0.1/verification/README.md +79 -0
  80. certcrypt_sdk-1.0.1/verification/index.json +302 -0
  81. certcrypt_sdk-0.0.0/.gitignore +0 -68
  82. certcrypt_sdk-0.0.0/LICENSE +0 -1
  83. certcrypt_sdk-0.0.0/PKG-INFO +0 -11
  84. certcrypt_sdk-0.0.0/README.md +0 -1
  85. certcrypt_sdk-0.0.0/pyproject.toml +0 -12
  86. certcrypt_sdk-0.0.0/src/certcrypt_sdk/__init__.py +0 -1
@@ -0,0 +1,12 @@
1
+ # CERTCRYPT repository ownership
2
+
3
+ # Default owners for everything not matched below.
4
+ # More specific rules further down override this catch-all.
5
+ * @CERTCRYPT/core-maintainers
6
+
7
+ /.gitignore @CERTCRYPT/core-maintainers
8
+ /.github/CODEOWNERS @CERTCRYPT/core-maintainers
9
+ /.github/workflows/ @CERTCRYPT/core-maintainers
10
+ /SECURITY.md @CERTCRYPT/core-maintainers
11
+ /LICENSE @CERTCRYPT/core-maintainers
12
+ /README.md @CERTCRYPT/core-maintainers
@@ -0,0 +1,106 @@
1
+ # CI for certcrypt-sdk-python — the issuer-side SDK.
2
+ #
3
+ # WHY THIS JOB NEEDS NODE. The cross-binding tests hand a certificate this SDK
4
+ # minted to certcrypt-verifier-toolkit-js and require it to verify —
5
+ # the assertion that makes the language bindings siblings rather than lookalikes.
6
+ # That runs the real JavaScript verifier, so the runner needs Node and a BUILT
7
+ # toolkit checkout, not just Python.
8
+ #
9
+ # THE SIBLING CHECKOUTS ARE REQUIRED, and no flag is needed to make them so. When
10
+ # a sibling is absent, tests/conftest.py turns the skip into a failure naming the
11
+ # missing path — by default, because a suite reporting `passed` having never
12
+ # checked parity would be attesting to something it did not do. This job checks
13
+ # the siblings out, so it cannot pass by skipping the part that matters. The
14
+ # conformance VERSION is checked too, so this job also proves the SDK was run
15
+ # against the contract version it claims.
16
+
17
+ name: CI
18
+
19
+ on:
20
+ push:
21
+ branches: [main]
22
+ pull_request:
23
+ branches: [main]
24
+ workflow_dispatch:
25
+
26
+ permissions:
27
+ contents: read
28
+
29
+ jobs:
30
+ test:
31
+ name: Python ${{ matrix.python }}
32
+ runs-on: ubuntu-latest
33
+
34
+ strategy:
35
+ fail-fast: false
36
+ matrix:
37
+ # The floor declared in pyproject.toml `requires-python`, and current
38
+ # stable. The floor is what an integrator may actually be running.
39
+ python: ["3.10", "3.13"]
40
+
41
+ steps:
42
+ - name: Check out the SDK
43
+ uses: actions/checkout@v4
44
+ with:
45
+ path: certcrypt-sdk-python
46
+
47
+ - name: Check out the conformance contract
48
+ uses: actions/checkout@v4
49
+ with:
50
+ repository: CERTCRYPT/certcrypt-conformance
51
+ path: certcrypt-conformance
52
+
53
+ - name: Check out the verifier toolkit
54
+ uses: actions/checkout@v4
55
+ with:
56
+ repository: CERTCRYPT/certcrypt-verifier-toolkit-js
57
+ path: certcrypt-verifier-toolkit-js
58
+
59
+ - uses: actions/setup-node@v4
60
+ with:
61
+ node-version: "20"
62
+ cache: npm
63
+ cache-dependency-path: certcrypt-verifier-toolkit-js/package-lock.json
64
+
65
+ - name: Build the verifier toolkit
66
+ working-directory: certcrypt-verifier-toolkit-js
67
+ # The cross-binding tests import the toolkit's BUILT output, so a checkout
68
+ # alone is not enough — an unbuilt sibling reads as a missing one.
69
+ run: |
70
+ npm ci
71
+ npm run build
72
+
73
+ - uses: actions/setup-python@v5
74
+ with:
75
+ python-version: ${{ matrix.python }}
76
+ cache: pip
77
+ cache-dependency-path: certcrypt-sdk-python/pyproject.toml
78
+
79
+ - name: Install
80
+ working-directory: certcrypt-sdk-python
81
+ run: pip install -e ".[dev]"
82
+
83
+ - name: Tests — the contract is required, skips are failures
84
+ working-directory: certcrypt-sdk-python
85
+ run: python -m pytest tests -q
86
+
87
+ - name: The built wheel carries no test material
88
+ working-directory: certcrypt-sdk-python
89
+ # What ships is decided by the hatch build config, not by the test run. A
90
+ # stray test module in the wheel is a packaging defect no test catches.
91
+ # This also pins that py.typed ships: without that marker the type
92
+ # annotations are invisible downstream, and the `Typing :: Typed`
93
+ # classifier in pyproject.toml would be claiming something untrue.
94
+ run: |
95
+ pip install build
96
+ python -m build --wheel -o dist_ci
97
+ python - <<'PY'
98
+ import glob, sys, zipfile
99
+ names = zipfile.ZipFile(sorted(glob.glob("dist_ci/*.whl"))[-1]).namelist()
100
+ leaked = [n for n in names if "test" in n.lower() and "dist-info" not in n]
101
+ if leaked:
102
+ sys.exit(f"Test material would be published: {leaked}")
103
+ if not any(n.endswith("certcrypt/py.typed") for n in names):
104
+ sys.exit("py.typed is missing: the Typing :: Typed classifier would lie")
105
+ print(f"wheel clean: {len(names)} files, py.typed present")
106
+ PY
@@ -0,0 +1,88 @@
1
+ # Secrets and key material
2
+ # ·················
3
+ # The issuer's keyset seed is the whole identity: whatever holds it must never be
4
+ # committed. These patterns are deliberately broad — a false positive costs one
5
+ # `git add -f`, a false negative is unrecoverable once pushed.
6
+ .env
7
+ .env.*
8
+ !.env.example
9
+ *.pem
10
+ *.key
11
+ *.p12
12
+ *.pfx
13
+ *.crt
14
+ *.cer
15
+ *.der
16
+ *.jks
17
+ *.keystore
18
+ id_rsa*
19
+ id_ed25519*
20
+ *.secrets.*
21
+ *.local.*
22
+
23
+ # Never commit non-public notes
24
+ # ·················
25
+ *.private.*
26
+ *.internal.*
27
+
28
+ # Build output
29
+ # ·················
30
+ # `dist/` and the wheel are not committed but ARE published: what ships to PyPI
31
+ # is governed by the `[tool.hatch.build.targets.wheel]` packages list in
32
+ # pyproject.toml, not by this file.
33
+ #
34
+ # NOTE the paths: the package lives in `src/certcrypt/`, so these entries are
35
+ # anchored with a leading slash. A bare `lib/` or `build/` would also match
36
+ # anything by that name INSIDE the package, and a source file would drop out of
37
+ # a commit without failing anything locally — it is still on disk, and only
38
+ # whoever cloned the repo would find it missing.
39
+ /build/
40
+ /dist/
41
+ /sdist/
42
+ /wheels/
43
+ *.egg-info/
44
+ *.egg
45
+ MANIFEST
46
+
47
+ # Python bytecode and caches
48
+ # ·················
49
+ __pycache__/
50
+ *.py[cod]
51
+ *$py.class
52
+
53
+ # Virtual environments
54
+ # ·················
55
+ .venv/
56
+ venv/
57
+ ENV/
58
+ .python-version
59
+
60
+ # Test and type-checking output
61
+ # ·················
62
+ .pytest_cache/
63
+ .mypy_cache/
64
+ .ruff_cache/
65
+ .tox/
66
+ .nox/
67
+ .coverage
68
+ .coverage.*
69
+ htmlcov/
70
+
71
+ # Logs
72
+ # ·················
73
+ *.log
74
+
75
+ # Editors and OS
76
+ # ·················
77
+ .vscode/
78
+ .idea/
79
+ *.swp
80
+ *.swo
81
+ .DS_Store
82
+ Thumbs.db
83
+
84
+ # Scratch
85
+ # ·················
86
+ tmp/
87
+ .tmp/
88
+ *.bak
@@ -0,0 +1,13 @@
1
+ # Working in this repository
2
+
3
+ This repository is public. Keep every contribution self-contained and suitable
4
+ for public distribution.
5
+
6
+ - Write for readers who have this repository and the public sources it links to.
7
+ - Describe what the code does and why. Leave change history to version control.
8
+ - Include only information needed to understand, use, or evaluate this code.
9
+ - Do not add secrets, personal data, environment-specific values, or
10
+ unpublished material.
11
+ - Write commit messages in English.
12
+ - Run the repository checks before committing. Do not bypass them; report a
13
+ false positive instead.
@@ -0,0 +1,66 @@
1
+ # CHANGELOG
2
+
3
+ This package follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
+
5
+ Entries are one line per change: `type:scope: what changed`, where `type` is
6
+ `feature`, `bugfix`, `breaking`, `deprecation`, `security` or `docs`.
7
+
8
+ ## 1.0.1
9
+
10
+ * bugfix:Tests: the context snapshot signature test verifies the P-256 half with `ecdsa`, a dependency of the SDK, so `pip install -e ".[dev]"` is enough to run the whole suite
11
+
12
+ ## 1.0.0
13
+
14
+ * feature:Settlement: `build_verification_package()` requires `base_certificate`; every package carries it with `verification_context` (verification-package/1), which is what an offline verifier in package mode accepts
15
+ * feature:Consistency: `assemble_context_snapshot_certificate` mints a CCVP/1 context snapshot certificate (`payload.snapshot` plus one `subject.context-snapshot/1` subject committing to it, shape and profile preconditions checked before signing); `assemble_base_certificate` takes an optional `context` (the snapshot issuer by `signer.id` and composite key fingerprint, and the `context_set_id`); `issuer_key_fingerprint_hex` gives that fingerprint. Held to the `ccvp-consistency` vectors
16
+ * feature:Formats: lowercase-hex and timestamp checks match the whole string; a trailing newline is refused
17
+ * security:Issuance: `subject.ai-decision/1` accepts one bounded decision record with a canonical decision id, one declared model, an explicit client/runtime observation boundary, real UTC millisecond timestamps, and ordered multimodal input/output parts; every part has a globally unique id and nonce, a lowercase MIME essence, an admitted profile and a salted CCCP commitment, while parameters and context remain bounded flat string maps
18
+ * feature:Issuance: `build_ai_decision_subject` generates independent part nonces, computes profile-aware commitments, validates the complete decision record and returns the subject plus private opening material; `build_ai_decision_part` provides the same operation for one part
19
+ * security:Issuance: the material of the JSON subject profiles (`subject.collection/1`, `subject.ai-decision/1`, `subject.context-snapshot/1`) is parsed strictly (`certcrypt.crypto.strict_json`): a member name repeated in any object, at any depth and after escape decoding, refuses the subject before it is canonicalized, and so do `NaN`, `Infinity` and a leading byte-order mark. Held to the new conformance family `strict-json`
20
+ * security:Node authentication: the issuer proof signs `certcrypt:issuer-auth:1|<challenge>|<host>|<METHOD> <path?query>|<sha3-256 of the body>` (`issuer_auth_message`), so a copy is good only for repeating that very request. The client's `issuer_auth_proof` provider receives the request (method, url, body)
21
+ * feature:Retries: every attempt of `issue()` and of a read carries a newly minted issuer proof, because the node refuses a challenge it has already accepted; a retry of a request that reached the node is therefore never refused as a replay
22
+ * security:Issuance: the issuer's signing key depends on the seed alone — P-256 from `SHA3-256(seed || "issuer-cert-key/p256")`, ML-DSA-65 from `SHA3-256(seed || "issuer-cert-key/mldsa")`; `issuer_key_id` is a label that never changes the key, and its default is `"issuer:" + keyset_root[0:32]`. Held to the new conformance family `issuer-key-derivation`
23
+ * feature:Exports: `ZERO_DATA_PROFILE`, `COMMITMENT_LEAF_VERSION`, `PROFILE_P256_MLDSA65`, `COLLECTION_MERKLE_SCHEME`, `SUBJECT_CONTEXT_SNAPSHOT`, `SettlementProgress`, `BuiltCollection` and `ResolvedCollection`; `SUPPORTED_SUBJECT_PROFILES` lists `subject.context-snapshot/1`, which this SDK implements
24
+ * feature:Issuance: `mode="unlinkable"` with a `tree_size` below 2 is refused at construction (`unlinkable mode needs a treeSize >= 2 (a distinct leaf per cert)`), and so is a `commitment_ttl_seconds` that is not a positive whole number of seconds
25
+ * feature:Issuance: `Certcrypt` takes `retry_base_ms` and `retry_cap_ms` alongside `retry_max_elapsed_ms` and `retry_max_attempts`
26
+ * feature:Issuance: `resolve_emission()` takes an optional `verification_context`, defaulting to the instance's `rules_version` and `system_id`. It reads the operation once and waits only when asked (`max_attempts` above 1, `max_wait_ms` or `strategy="auto"`); a wait that ends without a terminal state resolves as `pending`. Every terminal state other than `independent_ready` and `expired` resolves as `rejected`, on the by-commitment fallback too
27
+ * feature:Issuance: `EmissionHandle.from_dict()` requires `commitment_index`; it never defaults a missing one to 0, which would yield an inclusion proof that verifies against nothing
28
+ * docs:Issuance: `prepare()` checks, in order: activation, pool, holder, root fingerprint, system id, subjects, subject profiles, then TTL. An optional value falls back only when absent (`None`): an explicit `0` or empty string is used as given
29
+ * feature:Settlement: `wait_for_operation()` raises `CertcryptNodeError` (`operation <id> did not reach a terminal state after <n>s (last state: <state>)`, plus the window when one was reported) when the wait ends without a terminal state, `build_verification_package()` raises the same way
30
+ * feature:Settlement: `wait_for_operation()` takes `max_attempts` and `strategy` (`"auto"` or `"fixed"`); `interval_ms` or `max_attempts` selects `"fixed"` (default 60 polls at 1 s) and `"auto"` is bounded by `max_wait_ms` (default 15 minutes). It runs on the client's clock (`now_ms` and `sleep` on `CertcryptNodeClient`)
31
+ * feature:Settlement: `OperationRecord.settlement_progress` and `WaitProgress.settlement` (`SettlementProgress`: `phase`, `progress_ppm`, `observed_at`, and nothing else from the wire), and `WaitProgress.message` names the real wait — the window, an overdue window, or on-chain irreversibility with its percentage
32
+ * feature:Settlement: an exception raised by `on_progress` is swallowed, and without `on_progress` a sleep of ten seconds or more, or an overdue window, is logged at INFO on the `certcrypt` logger
33
+ * feature:Settlement: `SettlementWindowEstimate.expected_settled_by` (and `UnresolvedEmission.expected_settled_by`) carry the operator's estimate of when the window's settlement is anchored and final — never earlier than `target_close_by`, present exactly when it is, operational only. `wait_for_operation()` checks twice before `overdue`: 60 % of the way from `target_close_by` to that instant, then at that instant plus one second, each pushed back by a random 0–1 s so the operations of one window do not ask at once; `overdue` (on `WaitProgress` and on a `pending` resolution) is true only once it has passed; the progress message names the expected instant, and an overdue one says settlement is past the operator's expected instant. Without it, the wait sleeps until `target_close_by` plus three seconds and `overdue` follows `target_close_by`
34
+ * feature:Settlement: a window `target_close_by` or `expected_settled_by` with fractional seconds (`…:00.000Z`) or an offset is read as an instant
35
+ * feature:Node client: `health()` is one request bounded at 30 seconds that reports `False` on a transport failure or a non-2xx status
36
+ * security:Activation: an activation answer is read fail-closed, in order: not a JSON object (`activate returned no JSON object`), a required field absent or empty (`activate returned no …`), a field of the wrong type — `level1_binding` not an object, `level1_signature` not a composite signature, `holder_id`/`pool_id` not strings (`activate returned a malformed …`), or a `status` other than `redeemed`/`already_consumed_same_root` (`activate returned an unrecognized status`). Each raises `CertcryptNodeError` with no HTTP status, and nothing is cached or persisted.
37
+ * feature:Node auth: The node is a transport. The SDK activates and submits through it and asks it for nothing else — no identity proof, no pinned key. A node that is not recognized gets nothing admitted, and one that misbehaves can delay or drop a submission but never forge or alter what is signed: the certificate is signed here, and the `Proof of Independence` that comes back is signed by the CERTCRYPT System Domain, which any verifier checks offline with the verifier toolkit
38
+ * feature:Activation: `activate()` sends the request `POST /v1/activate` accepts — the activation `code`, the key-set root, a leaf disclosure with its ML-DSA-65 possession signature over `certcrypt:activate:1|<code>|<root>`, `rules_version`, `system_root_fingerprint` and a validity window stable across restarts — and reads `level1_binding`/`level1_signature`, `holder_id` and `pool_id` from the answer. `already_consumed_same_root` is a success, `integration_key_replaced` and `key_set_root_already_bound` surface on `CertcryptNodeError.code` without a retry, and `CertcryptNodeClient.activate()` returns an `ActivationResult`. `valid_until` sets the end of the window; its start is fixed by the issuance service
39
+ * security:Issuance: the issuer authenticates every request to the node (`x-certcrypt-issuer-auth`, a fresh self-verifying proof) and signs every read (`x-certcrypt-issuer-read`) over the id the server routes on. A member the node delivered late is learned from the first read that shows its upstream id; a restored handle registers its own
40
+ * feature:Node client: `pre_evaluation_rejected` is final and not retried — the node sends it with HTTP 200 and the same set always gets the same answer
41
+ * feature:Issuance: `Certcrypt.issue()` — the single issuance surface: derives the signing key from your seed, canonicalizes each subject byte-identically to the verifier, computes the commitment, mints the signed base certificate and submits the issuance
42
+ * feature:Issuance: No opaque-digest mode — a certificate always commits to real content, so a third party can bind the proof to those exact bytes
43
+ * feature:Issuance: Multi-subject certificates under one signature; order is significant and `subjects[0]` is the primary face
44
+ * feature:Issuance: Six subject profiles — `subject.binary/1`, `subject.text/1` (line-ending normalized), `subject.email/1` (RFC 5322 header-unfolded), `subject.collection/1` and `subject.ai-decision/1` (canonicalized by value under RFC 8785 after a string-only precondition), and `subject.context-snapshot/1` (canonicalized by value, no JSON number at any depth)
45
+ * feature:`EmissionHandle`: A serializable operation handle — persist it and `resolve_emission()` finishes the job after a restart or in another process, without re-emitting; exactly one node operation per certificate
46
+ * feature:Issuance: Explicit failure where a silent default would mint a rejected certificate — an unknown `rules_version` without an explicit TTL raises rather than defaulting to a far-future expiry, and an empty `system_id` raises rather than producing a certificate every conformant verifier refuses
47
+ * feature:Cryptography: Composite PQ/T signatures — ECDSA-P-256-SHA3-256 (classical, first; order is load-bearing) AND ML-DSA-65 (FIPS 204), each over the same domain-separated message, valid only as the AND of all components
48
+ * feature:Cryptography: ECDSA signatures are RFC 6979 deterministic — SHA3-256 prehash, nonce from HMAC-SHA3-256, low-s, raw `r||s` — so the same key over the same message always yields the same signature, held to the conformance family `ecdsa-p256-deterministic`; a random-nonce signature over the same message is equally valid and each verifies under the other. The ML-DSA-65 component stays hedged
49
+ * feature:Cryptography: The signing key never leaves the process — derived deterministically from the 32-byte seed you provision
50
+ * feature:Cryptography: No API signs a single component, so there is no way to produce something that looks like a signature but carries no post-quantum half
51
+ * feature:Byte contracts: SHA3-256 from the standard library (FIPS 202, not Keccak) and RFC 8785 JCS, with the three places Python's `json` diverges from RFC 8785 handled explicitly — UTF-16 code-unit key ordering, ECMAScript number serialization, and non-ASCII staying literal
52
+ * feature:Byte contracts: Two constructions deliberately break the "canonical means JCS" rule and are pinned by tests — the commitment leaf preimage and the projected commitment serialize in INSERTION order
53
+ * feature:Byte contracts: The collection fold and the holder-keyset Merkle are separate modules — different constructions over the same digest (ASCII tags with length prefixes versus `0x00`/`0x01` discriminators), and swapping them produces a root wrong in a way no length check catches
54
+ * feature:Zero-data: The issuer's stable identifiers are projected to operation-scoped pseudonyms and never appear in the capacity evidence; a test serializes the whole evidence and asserts none of them appears
55
+ * feature:Zero-data: Per-operation leaf keys from a Merkle tree derived from the master seed, so two commitments from the same issuer share only the root; `mode="unlinkable"` requires a `LeafStore` at construction rather than defaulting to something that silently reuses a leaf
56
+ * feature:Node client: Standard library only (`urllib`), so the SDK carries no HTTP dependency; a transport can be injected for callers who prefer `requests` or `httpx`
57
+ * feature:Node client: Submission sets bounded at 64 members (`MAX_SUBMISSION_SET_MEMBERS`). `Certcrypt.submit()` and `CertcryptNodeClient.issue()` refuse more than 64 commitments with `SubmissionSetTooLargeError` before anything is sent; `assert_submission_set_within_bound()` is exported for a caller that groups commitments itself. A fail-fast guard, not a security boundary: the node and the submit endpoint reject an over-cardinality set fail-closed regardless
58
+ * feature:Node client: Idempotent retries with exponential backoff and full jitter; `issue()` fixes a ULID `request_id` once and resends the same signed set under it, so a retry never re-signs and never double-submits; terminal verdicts fail fast
59
+ * feature:Node client: Retries follow the `transport-retry` policy — a node's `Retry-After` (a restart, an outbox it cannot write) is waited out exactly, clamped to 1 s – 15 min, and never counted as an attempt; retrying ends on a time budget (`retry_max_elapsed_ms`, default 120 s) with no attempt limit unless `retry_max_attempts` is set; a 4xx other than 408/425/429 is raised at once instead of retried. `CertcryptNodeError.retry_after_ms` carries the node's requested wait when the client gives up
60
+ * feature:Node client: `list_dead_letters()` and `redrive_dead_letter(request_id)` — the submissions the node stopped retrying (a refusal about the request or its credentials, never an outage) and how to put one back once the cause is fixed; the same signed set is resent, nothing re-signed
61
+ * feature:Node client: A member the node delivered late (`accepted_for_retry` at submit) keeps the operation id it was given; the first read that reveals its upstream id hands it to `on_upstream_operation_id`
62
+ * feature:Node client: Waiting is scheduled, not spun — the client sleeps until the settlement window the node reports instead of polling, and says when an operation is running late
63
+ * feature:Node client: `accepted_for_retry` is not terminal; the node has durable custody and will deliver
64
+ * feature:Conformance: Validates against the published vectors in `certcrypt-conformance`, which are NOT vendored — the contract is versioned separately and a copy would drift; tests fail with a message naming what to check out when the sibling is absent (`CERTCRYPT_ALLOW_MISSING_CONFORMANCE=1` turns those failures into skips)
65
+ * feature:Conformance: Certificates minted here are round-tripped through `certcrypt-verifier-toolkit-js`, which verifies both composite components on every run
66
+ * feature:Packaging: Requires Python 3.10 or newer, Apache-2.0. Server-side only — the issuer seed must never reach a client device
@@ -0,0 +1,178 @@
1
+ Copyright 2025-2026 CERTCRYPT, Inc., its affiliates or licensors. All rights reserved.
2
+
3
+ Apache License
4
+ Version 2.0, January 2004
5
+ http://www.apache.org/licenses/
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. Definitions.
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction,
12
+ and distribution as defined by Sections 1 through 9 of this document.
13
+
14
+ "Licensor" shall mean the copyright owner or entity authorized by
15
+ the copyright owner that is granting the License.
16
+
17
+ "Legal Entity" shall mean the union of the acting entity and all
18
+ other entities that control, are controlled by, or are under common
19
+ control with that entity. For the purposes of this definition,
20
+ "control" means (i) the power, direct or indirect, to cause the
21
+ direction or management of such entity, whether by contract or
22
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
23
+ outstanding shares, or (iii) beneficial ownership of such entity.
24
+
25
+ "You" (or "Your") shall mean an individual or Legal Entity
26
+ exercising permissions granted by this License.
27
+
28
+ "Source" form shall mean the preferred form for making modifications,
29
+ including but not limited to software source code, documentation
30
+ source, and configuration files.
31
+
32
+ "Object" form shall mean any form resulting from mechanical
33
+ transformation or translation of a Source form, including but
34
+ not limited to compiled object code, generated documentation,
35
+ and conversions to other media types.
36
+
37
+ "Work" shall mean the work of authorship, whether in Source or
38
+ Object form, made available under the License, as indicated by a
39
+ copyright notice that is included in or attached to the work
40
+ (an example is provided in the Appendix below).
41
+
42
+ "Derivative Works" shall mean any work, whether in Source or Object
43
+ form, that is based on (or derived from) the Work and for which the
44
+ editorial revisions, annotations, elaborations, or other modifications
45
+ represent, as a whole, an original work of authorship. For the purposes
46
+ of this License, Derivative Works shall not include works that remain
47
+ separable from, or merely link (or bind by name) to the interfaces of,
48
+ the Work and Derivative Works thereof.
49
+
50
+ "Contribution" shall mean any work of authorship, including
51
+ the original version of the Work and any modifications or additions
52
+ to that Work or Derivative Works thereof, that is intentionally
53
+ submitted to Licensor for inclusion in the Work by the copyright owner
54
+ or by an individual or Legal Entity authorized to submit on behalf of
55
+ the copyright owner. For the purposes of this definition, "submitted"
56
+ means any form of electronic, verbal, or written communication sent
57
+ to the Licensor or its representatives, including but not limited to
58
+ communication on electronic mailing lists, source code control systems,
59
+ and issue tracking systems that are managed by, or on behalf of, the
60
+ Licensor for the purpose of discussing and improving the Work, but
61
+ excluding communication that is conspicuously marked or otherwise
62
+ designated in writing by the copyright owner as "Not a Contribution."
63
+
64
+ "Contributor" shall mean Licensor and any individual or Legal Entity
65
+ on behalf of whom a Contribution has been received by Licensor and
66
+ subsequently incorporated within the Work.
67
+
68
+ 2. Grant of Copyright License. Subject to the terms and conditions of
69
+ this License, each Contributor hereby grants to You a perpetual,
70
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
71
+ copyright license to reproduce, prepare Derivative Works of,
72
+ publicly display, publicly perform, sublicense, and distribute the
73
+ Work and such Derivative Works in Source or Object form.
74
+
75
+ 3. Grant of Patent License. Subject to the terms and conditions of
76
+ this License, each Contributor hereby grants to You a perpetual,
77
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78
+ (except as stated in this section) patent license to make, have made,
79
+ use, offer to sell, sell, import, and otherwise transfer the Work,
80
+ where such license applies only to those patent claims licensable
81
+ by such Contributor that are necessarily infringed by their
82
+ Contribution(s) alone or by combination of their Contribution(s)
83
+ with the Work to which such Contribution(s) was submitted. If You
84
+ institute patent litigation against any entity (including a
85
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
86
+ or a Contribution incorporated within the Work constitutes direct
87
+ or contributory patent infringement, then any patent licenses
88
+ granted to You under this License for that Work shall terminate
89
+ as of the date such litigation is filed.
90
+
91
+ 4. Redistribution. You may reproduce and distribute copies of the
92
+ Work or Derivative Works thereof in any medium, with or without
93
+ modifications, and in Source or Object form, provided that You
94
+ meet the following conditions:
95
+
96
+ (a) You must give any other recipients of the Work or Derivative
97
+ Works a copy of this License; and
98
+
99
+ (b) You must cause any modified files to carry prominent notices
100
+ stating that You changed the files; and
101
+
102
+ (c) You must retain, in the Source form of any Derivative Works
103
+ that You distribute, all copyright, patent, trademark, and
104
+ attribution notices from the Source form of the Work,
105
+ excluding those notices that do not pertain to any part of
106
+ the Derivative Works; and
107
+
108
+ (d) If the Work includes a "NOTICE" text file as part of its
109
+ distribution, then any Derivative Works that You distribute must
110
+ include a readable copy of the attribution notices contained
111
+ within such NOTICE file, excluding those notices that do not
112
+ pertain to any part of the Derivative Works, in at least one
113
+ of the following places: within a NOTICE text file distributed
114
+ as part of the Derivative Works; within the Source form or
115
+ documentation, if provided along with the Derivative Works; or,
116
+ within a display generated by the Derivative Works, if and
117
+ wherever such third-party notices normally appear. The contents
118
+ of the NOTICE file are for informational purposes only and
119
+ do not modify the License. You may add Your own attribution
120
+ notices within Derivative Works that You distribute, alongside
121
+ or as an addendum to the NOTICE text from the Work, provided
122
+ that such additional attribution notices cannot be construed
123
+ as modifying the License.
124
+
125
+ You may add Your own copyright statement to Your modifications and
126
+ may provide additional or different license terms and conditions
127
+ for use, reproduction, or distribution of Your modifications, or
128
+ for any such Derivative Works as a whole, provided Your use,
129
+ reproduction, and distribution of the Work otherwise complies with
130
+ the conditions stated in this License.
131
+
132
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
133
+ any Contribution intentionally submitted for inclusion in the Work
134
+ by You to the Licensor shall be under the terms and conditions of
135
+ this License, without any additional terms or conditions.
136
+ Notwithstanding the above, nothing herein shall supersede or modify
137
+ the terms of any separate license agreement you may have executed
138
+ with Licensor regarding such Contributions.
139
+
140
+ 6. Trademarks. This License does not grant permission to use the trade
141
+ names, trademarks, service marks, or product names of the Licensor,
142
+ except as required for reasonable and customary use in describing the
143
+ origin of the Work and reproducing the content of the NOTICE file.
144
+
145
+ 7. Disclaimer of Warranty. Unless required by applicable law or
146
+ agreed to in writing, Licensor provides the Work (and each
147
+ Contributor provides its Contributions) on an "AS IS" BASIS,
148
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
149
+ implied, including, without limitation, any warranties or conditions
150
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
151
+ PARTICULAR PURPOSE. You are solely responsible for determining the
152
+ appropriateness of using or redistributing the Work and assume any
153
+ risks associated with Your exercise of permissions under this License.
154
+
155
+ 8. Limitation of Liability. In no event and under no legal theory,
156
+ whether in tort (including negligence), contract, or otherwise,
157
+ unless required by applicable law (such as deliberate and grossly
158
+ negligent acts) or agreed to in writing, shall any Contributor be
159
+ liable to You for damages, including any direct, indirect, special,
160
+ incidental, or consequential damages of any character arising as a
161
+ result of this License or out of the use or inability to use the
162
+ Work (including but not limited to damages for loss of goodwill,
163
+ work stoppage, computer failure or malfunction, or any and all
164
+ other commercial damages or losses), even if such Contributor
165
+ has been advised of the possibility of such damages.
166
+
167
+ 9. Accepting Warranty or Additional Liability. While redistributing
168
+ the Work or Derivative Works thereof, You may choose to offer,
169
+ and charge a fee for, acceptance of support, warranty, indemnity,
170
+ or other liability obligations and/or rights consistent with this
171
+ License. However, in accepting such obligations, You may act only
172
+ on Your own behalf and on Your sole responsibility, not on behalf
173
+ of any other Contributor, and only if You agree to indemnify,
174
+ defend, and hold each Contributor harmless for any liability
175
+ incurred by, or claims asserted against, such Contributor by reason
176
+ of your accepting any such warranty or additional liability.
177
+
178
+ END OF TERMS AND CONDITIONS