certanix-verify 0.14.0__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.
- certanix_verify-0.14.0/CHANGELOG.md +14 -0
- certanix_verify-0.14.0/LICENSE +14 -0
- certanix_verify-0.14.0/NOTICE +1 -0
- certanix_verify-0.14.0/PATENTS-NOTICE.md +9 -0
- certanix_verify-0.14.0/PKG-INFO +170 -0
- certanix_verify-0.14.0/README.md +149 -0
- certanix_verify-0.14.0/VENDORED.json +28 -0
- certanix_verify-0.14.0/man/certanix-verify.1 +194 -0
- certanix_verify-0.14.0/pyproject.toml +37 -0
- certanix_verify-0.14.0/src/certanix_verify/__init__.py +41 -0
- certanix_verify-0.14.0/src/certanix_verify/__main__.py +30 -0
- certanix_verify-0.14.0/src/certanix_verify/_core.py +1126 -0
- certanix_verify-0.14.0/src/certanix_verify/_descriptors.py +29 -0
- certanix_verify-0.14.0/src/certanix_verify/_vault.py +775 -0
- certanix_verify-0.14.0/src/certanix_verify/cli.py +357 -0
- certanix_verify-0.14.0/src/certanix_verify/descriptors.json +3188 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# certanix-verify changelog
|
|
2
|
+
|
|
3
|
+
What each version of the offline verifier accepts and refuses.
|
|
4
|
+
|
|
5
|
+
## 0.14.0 (unreleased)
|
|
6
|
+
|
|
7
|
+
- First public release. Verifies Certanix evidence packs offline: the canonical bytes
|
|
8
|
+
against the signature, the evidence-pack schema and the recorded capability gate;
|
|
9
|
+
byte-exact verification of canonical bytes against a detached bundle (`--bundle`);
|
|
10
|
+
standalone signed artifacts that name their own type (`--standalone`): delta reports
|
|
11
|
+
and refusals, self-evidence, and EU Control and Origin Attestations, including
|
|
12
|
+
attestation renewal chains (`--chain`); and Certanix Vault evidence records with
|
|
13
|
+
their RFC 3161 timestamps (`certanix-verify vault`).
|
|
14
|
+
- Released under BSD-3-Clause-Clear. See LICENSE, NOTICE and PATENTS-NOTICE.md.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
The Clear BSD License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, GovStrat SRL
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
9
|
+
|
|
10
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
11
|
+
|
|
12
|
+
* Neither the name of GovStrat SRL nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
13
|
+
|
|
14
|
+
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
certanix-verify is developed by Certanix, currently held by GovStrat SRL pending the incorporation of Certanix SA (Luxembourg). Copyright and all related rights will be assigned to Certanix SA on its incorporation, and the copyright holder in this notice and in the LICENSE file will be updated accordingly in the next release.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Patent non-assertion for verification.
|
|
2
|
+
|
|
3
|
+
GovStrat SRL, applicant of European patent applications EP26301289.0 and EP26301292.4, and its successors in title, including Certanix SA once incorporated, will not assert any claim of those applications, of any patent granted on them, or of any application or patent claiming their priority, against any person or organisation for making, using, copying, modifying or distributing certanix-verify, solely for the purpose of verifying evidence packs and related documents in the published Certanix evidence-pack format.
|
|
4
|
+
|
|
5
|
+
This commitment does not cover generating, signing or producing evidence packs or any other document, nor any other product or service.
|
|
6
|
+
|
|
7
|
+
It is irrevocable for use made in reliance on it, except that it ends for any party that asserts a patent against GovStrat SRL, Certanix SA or users of certanix-verify in connection with the verification of evidence packs.
|
|
8
|
+
|
|
9
|
+
This notice is not a licence. The BSD-3-Clause-Clear licence of this software grants no patent rights.
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: certanix-verify
|
|
3
|
+
Version: 0.14.0
|
|
4
|
+
Summary: Offline verification of Certanix evidence packs.
|
|
5
|
+
Project-URL: Homepage, https://certanix.eu/verify/
|
|
6
|
+
Project-URL: Schemas, https://schema.certanix.eu/
|
|
7
|
+
Author: GovStrat SRL
|
|
8
|
+
Maintainer: GovStrat SRL
|
|
9
|
+
License-Expression: BSD-3-Clause-Clear
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
License-File: NOTICE
|
|
12
|
+
License-File: PATENTS-NOTICE.md
|
|
13
|
+
Keywords: ecdsa,evidence,rfc3161,signature,verification
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Topic :: Security :: Cryptography
|
|
17
|
+
Requires-Python: >=3.10
|
|
18
|
+
Requires-Dist: asn1crypto==1.5.1
|
|
19
|
+
Requires-Dist: cryptography==48.0.1
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# certanix-verify
|
|
23
|
+
|
|
24
|
+
Verify a Certanix evidence pack offline. The standard library plus two pinned
|
|
25
|
+
dependencies, no network, no `cosign` binary, no transparency-log lookup, and nothing
|
|
26
|
+
from the Certanix platform.
|
|
27
|
+
|
|
28
|
+
**The two dependencies, and why** (from 0.6.0):
|
|
29
|
+
|
|
30
|
+
- `cryptography` checks signatures (ECDSA, RSA) and X.509 certificates.
|
|
31
|
+
- `asn1crypto`, pure Python with no compiled code, parses ASN.1: the RFC 3161 timestamp
|
|
32
|
+
tokens and RFC 4998 evidence records of the Certanix Vault, which `cryptography` cannot
|
|
33
|
+
read. Hand-written DER parsing was rejected as security-sensitive code with no second
|
|
34
|
+
reviewer, and a separate package was rejected because a person checking a disclosure
|
|
35
|
+
in 2036 should need to install one tool.
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## Quickstart
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pip install certanix-verify
|
|
42
|
+
certanix-verify verify evidence-pack.json --key cosign.pub
|
|
43
|
+
echo $? # 0 = verified; any other value is the failure class (see below)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## What it checks, and what it does not
|
|
47
|
+
|
|
48
|
+
It checks that the pack's **canonical bytes** — recomputed from the document exactly as
|
|
49
|
+
you supply it — match the detached signature made by the key you pass in, that the pack
|
|
50
|
+
satisfies the evidence-pack schema, and that it does not claim a capability its own
|
|
51
|
+
recorded capability gate denies.
|
|
52
|
+
|
|
53
|
+
It does **not** tell you whose key that is. A signature verifies against whatever key
|
|
54
|
+
you hand it, so confirm the key's fingerprint against an out-of-band source (a Certanix
|
|
55
|
+
deck appendix, printed collateral, a channel you already trust) before trusting what a
|
|
56
|
+
green result means. A verifier that implied otherwise would be lying by omission.
|
|
57
|
+
|
|
58
|
+
## Exit codes
|
|
59
|
+
|
|
60
|
+
The exit code **is** the failure class, so a script can branch on *why* verification
|
|
61
|
+
failed without parsing text:
|
|
62
|
+
|
|
63
|
+
| Code | Class | Meaning |
|
|
64
|
+
|---|---|---|
|
|
65
|
+
| 0 | `OK` | Signature valid over the canonical bytes; schema valid; no gate violation. |
|
|
66
|
+
| 1 | `USAGE` | Could not begin: unreadable pack, missing key, bad invocation. Says nothing about the pack. |
|
|
67
|
+
| 2 | `MALFORMED_INPUT` | Not parseable as a JSON object (e.g. truncated). |
|
|
68
|
+
| 3 | `SCHEMA_INVALID` | Parses, but violates the schema: missing required field, unknown field, value outside a closed vocabulary. |
|
|
69
|
+
| 4 | `UNSUPPORTED_SCHEMA_VERSION` | A schema version this verifier does not know. Refused rather than guessed at. |
|
|
70
|
+
| 5 | `SIGNATURE_MISSING` | The pack carries no signature — an unsigned pack, not a failed check. |
|
|
71
|
+
| 6 | `SIGNATURE_MALFORMED` | A signature is present but its container is not decodable. |
|
|
72
|
+
| 7 | `SIGNATURE_MISMATCH` | The cryptographic check failed: these are not the bytes that were signed. **The tamper class.** |
|
|
73
|
+
| 8 | `KEY_MISMATCH` | The signature names a different signer than the key supplied. |
|
|
74
|
+
| 9 | `GATE_VIOLATION` | Signature and schema are valid, but the pack claims a capability its recorded gate state denies. |
|
|
75
|
+
| 10 | `EVIDENCE_MISMATCH` | `vault` only: the evidence record does not cover these bytes. They changed after they were timestamped. |
|
|
76
|
+
| 11 | `TIMESTAMP_INVALID` | `vault` only: the RFC 3161 token is not valid (modified, or its signature fails). |
|
|
77
|
+
| 12 | `TSA_UNTRUSTED` | `vault` only: the token's signer does not chain to a trust anchor you supplied, is not a time-stamping certificate, or was not valid when the token was issued. |
|
|
78
|
+
| 13 | `TSA_EXPIRED` | `vault` only: the time-stamping certificate has expired at the verification time and nothing in the record renews it. |
|
|
79
|
+
|
|
80
|
+
## Vault evidence records (0.6.0)
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
certanix-verify vault evidence-record-0001.ers \
|
|
84
|
+
--data artefact --data manifest.json --tsa-root tsa-root.pem [--at 2036-01-01T00:00:00Z]
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
It shows that the data objects are unchanged since the time the TSA states, as attested
|
|
88
|
+
by the trust anchor you supply. From 0.7.0 it reads renewed records (RFC 4998 section 5):
|
|
89
|
+
a later timestamp over an earlier one, or a new chain under a newer hash algorithm. Each
|
|
90
|
+
timestamp must have been covered by the next before its certificate expired, and the
|
|
91
|
+
newest must be valid at the verification time; a renewal that came too late is
|
|
92
|
+
`TSA_EXPIRED`, and a broken link is `EVIDENCE_MISMATCH`. From 0.8.0 records are read
|
|
93
|
+
exactly as Bouncy Castle's independent RFC 4998 implementation reads them
|
|
94
|
+
(`org.bouncycastle.tsp.ers` 1.86, cross-checked 2026-10-08), and each record names the
|
|
95
|
+
hash-tree convention it was built with. It checks no revocation (it is offline), and it says
|
|
96
|
+
nothing about whether the content is true.
|
|
97
|
+
|
|
98
|
+
Note what code 3 does *not* mean: the verifier stops at the first failed check, so
|
|
99
|
+
`SCHEMA_INVALID` means it never got as far as the signature. It is not a statement that
|
|
100
|
+
the signature was fine.
|
|
101
|
+
|
|
102
|
+
Two failure modes are deliberately **not** distinguished. A wrong key and a mutated byte
|
|
103
|
+
are cryptographically identical from the outside; code 8 is reported only when the
|
|
104
|
+
signature bundle positively names a different signer, and otherwise the honest answer is
|
|
105
|
+
code 7. This verifier does not upgrade an ambiguous failure into a more specific
|
|
106
|
+
accusation.
|
|
107
|
+
|
|
108
|
+
## Machine-readable output
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
certanix-verify verify evidence-pack.json --key cosign.pub --json
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"verified": false,
|
|
117
|
+
"status": "SIGNATURE_MISMATCH",
|
|
118
|
+
"exit_code": 7,
|
|
119
|
+
"schema_version": "1.7",
|
|
120
|
+
"detail": "recomputed canonical bytes do not match the signed digest",
|
|
121
|
+
"verifier_version": "certanix-verify 0.3.0"
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
`exit_code` always equals the process exit code. `verified` is carried explicitly so a
|
|
126
|
+
consumer never has to know that zero means success.
|
|
127
|
+
|
|
128
|
+
## Two modes, deliberately different
|
|
129
|
+
|
|
130
|
+
**Pack mode** (the default) takes the pack JSON and *recomputes* its canonical form. A
|
|
131
|
+
pack that has been re-serialised somewhere in your toolchain — different indentation,
|
|
132
|
+
different key order, same content — still verifies. The signature binds the content, not
|
|
133
|
+
the transport encoding, and reporting a benign JSON round-trip as tampering would be a
|
|
134
|
+
false accusation.
|
|
135
|
+
|
|
136
|
+
**Byte-exact mode** takes a canonical-bytes file and its detached bundle:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
certanix-verify verify evidence-pack.canonical.json --bundle evidence-pack.bundle --key cosign.pub
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Here nothing is recomputed, so **any** byte change fails — including a re-serialisation
|
|
143
|
+
that pack mode accepts. That is the correct behaviour for an archived artifact whose
|
|
144
|
+
exact bytes are the claim. The two modes disagreeing on that one input is by design.
|
|
145
|
+
|
|
146
|
+
**Standalone mode** takes a signed artifact that is not a pack and names its own type in
|
|
147
|
+
`artifact_type`: a delta report or delta refusal, self-evidence, or an EU Control and
|
|
148
|
+
Origin Attestation (`attestation`):
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
certanix-verify verify attestation.json --standalone --key cosign.pub
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
The checks are the same as for a pack (structure, then the signature over the canonical
|
|
155
|
+
bytes recomputed from the document as presented), against that type's bundled schema. An
|
|
156
|
+
unknown or missing `artifact_type` is refused as an unsupported schema, never guessed.
|
|
157
|
+
|
|
158
|
+
## Provenance
|
|
159
|
+
|
|
160
|
+
`VENDORED.json` records where this verifier came from: the platform source file and its
|
|
161
|
+
SHA-256, the platform commit, and the schema version the bundled descriptors were taken
|
|
162
|
+
from. The verification logic here is generated verbatim from the platform's single
|
|
163
|
+
source — it is a copy, never a reimplementation — and the platform's CI asserts that
|
|
164
|
+
this copy and the platform agree on every case in the verification conformance corpus.
|
|
165
|
+
|
|
166
|
+
## Licence
|
|
167
|
+
|
|
168
|
+
BSD-3-Clause-Clear: see [LICENSE](LICENSE). Who holds the copyright, and the assignment
|
|
169
|
+
to come: see [NOTICE](NOTICE). Patents: see [PATENTS-NOTICE.md](PATENTS-NOTICE.md); the
|
|
170
|
+
licence itself grants no patent rights.
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# certanix-verify
|
|
2
|
+
|
|
3
|
+
Verify a Certanix evidence pack offline. The standard library plus two pinned
|
|
4
|
+
dependencies, no network, no `cosign` binary, no transparency-log lookup, and nothing
|
|
5
|
+
from the Certanix platform.
|
|
6
|
+
|
|
7
|
+
**The two dependencies, and why** (from 0.6.0):
|
|
8
|
+
|
|
9
|
+
- `cryptography` checks signatures (ECDSA, RSA) and X.509 certificates.
|
|
10
|
+
- `asn1crypto`, pure Python with no compiled code, parses ASN.1: the RFC 3161 timestamp
|
|
11
|
+
tokens and RFC 4998 evidence records of the Certanix Vault, which `cryptography` cannot
|
|
12
|
+
read. Hand-written DER parsing was rejected as security-sensitive code with no second
|
|
13
|
+
reviewer, and a separate package was rejected because a person checking a disclosure
|
|
14
|
+
in 2036 should need to install one tool.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## Quickstart
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install certanix-verify
|
|
21
|
+
certanix-verify verify evidence-pack.json --key cosign.pub
|
|
22
|
+
echo $? # 0 = verified; any other value is the failure class (see below)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## What it checks, and what it does not
|
|
26
|
+
|
|
27
|
+
It checks that the pack's **canonical bytes** — recomputed from the document exactly as
|
|
28
|
+
you supply it — match the detached signature made by the key you pass in, that the pack
|
|
29
|
+
satisfies the evidence-pack schema, and that it does not claim a capability its own
|
|
30
|
+
recorded capability gate denies.
|
|
31
|
+
|
|
32
|
+
It does **not** tell you whose key that is. A signature verifies against whatever key
|
|
33
|
+
you hand it, so confirm the key's fingerprint against an out-of-band source (a Certanix
|
|
34
|
+
deck appendix, printed collateral, a channel you already trust) before trusting what a
|
|
35
|
+
green result means. A verifier that implied otherwise would be lying by omission.
|
|
36
|
+
|
|
37
|
+
## Exit codes
|
|
38
|
+
|
|
39
|
+
The exit code **is** the failure class, so a script can branch on *why* verification
|
|
40
|
+
failed without parsing text:
|
|
41
|
+
|
|
42
|
+
| Code | Class | Meaning |
|
|
43
|
+
|---|---|---|
|
|
44
|
+
| 0 | `OK` | Signature valid over the canonical bytes; schema valid; no gate violation. |
|
|
45
|
+
| 1 | `USAGE` | Could not begin: unreadable pack, missing key, bad invocation. Says nothing about the pack. |
|
|
46
|
+
| 2 | `MALFORMED_INPUT` | Not parseable as a JSON object (e.g. truncated). |
|
|
47
|
+
| 3 | `SCHEMA_INVALID` | Parses, but violates the schema: missing required field, unknown field, value outside a closed vocabulary. |
|
|
48
|
+
| 4 | `UNSUPPORTED_SCHEMA_VERSION` | A schema version this verifier does not know. Refused rather than guessed at. |
|
|
49
|
+
| 5 | `SIGNATURE_MISSING` | The pack carries no signature — an unsigned pack, not a failed check. |
|
|
50
|
+
| 6 | `SIGNATURE_MALFORMED` | A signature is present but its container is not decodable. |
|
|
51
|
+
| 7 | `SIGNATURE_MISMATCH` | The cryptographic check failed: these are not the bytes that were signed. **The tamper class.** |
|
|
52
|
+
| 8 | `KEY_MISMATCH` | The signature names a different signer than the key supplied. |
|
|
53
|
+
| 9 | `GATE_VIOLATION` | Signature and schema are valid, but the pack claims a capability its recorded gate state denies. |
|
|
54
|
+
| 10 | `EVIDENCE_MISMATCH` | `vault` only: the evidence record does not cover these bytes. They changed after they were timestamped. |
|
|
55
|
+
| 11 | `TIMESTAMP_INVALID` | `vault` only: the RFC 3161 token is not valid (modified, or its signature fails). |
|
|
56
|
+
| 12 | `TSA_UNTRUSTED` | `vault` only: the token's signer does not chain to a trust anchor you supplied, is not a time-stamping certificate, or was not valid when the token was issued. |
|
|
57
|
+
| 13 | `TSA_EXPIRED` | `vault` only: the time-stamping certificate has expired at the verification time and nothing in the record renews it. |
|
|
58
|
+
|
|
59
|
+
## Vault evidence records (0.6.0)
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
certanix-verify vault evidence-record-0001.ers \
|
|
63
|
+
--data artefact --data manifest.json --tsa-root tsa-root.pem [--at 2036-01-01T00:00:00Z]
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
It shows that the data objects are unchanged since the time the TSA states, as attested
|
|
67
|
+
by the trust anchor you supply. From 0.7.0 it reads renewed records (RFC 4998 section 5):
|
|
68
|
+
a later timestamp over an earlier one, or a new chain under a newer hash algorithm. Each
|
|
69
|
+
timestamp must have been covered by the next before its certificate expired, and the
|
|
70
|
+
newest must be valid at the verification time; a renewal that came too late is
|
|
71
|
+
`TSA_EXPIRED`, and a broken link is `EVIDENCE_MISMATCH`. From 0.8.0 records are read
|
|
72
|
+
exactly as Bouncy Castle's independent RFC 4998 implementation reads them
|
|
73
|
+
(`org.bouncycastle.tsp.ers` 1.86, cross-checked 2026-10-08), and each record names the
|
|
74
|
+
hash-tree convention it was built with. It checks no revocation (it is offline), and it says
|
|
75
|
+
nothing about whether the content is true.
|
|
76
|
+
|
|
77
|
+
Note what code 3 does *not* mean: the verifier stops at the first failed check, so
|
|
78
|
+
`SCHEMA_INVALID` means it never got as far as the signature. It is not a statement that
|
|
79
|
+
the signature was fine.
|
|
80
|
+
|
|
81
|
+
Two failure modes are deliberately **not** distinguished. A wrong key and a mutated byte
|
|
82
|
+
are cryptographically identical from the outside; code 8 is reported only when the
|
|
83
|
+
signature bundle positively names a different signer, and otherwise the honest answer is
|
|
84
|
+
code 7. This verifier does not upgrade an ambiguous failure into a more specific
|
|
85
|
+
accusation.
|
|
86
|
+
|
|
87
|
+
## Machine-readable output
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
certanix-verify verify evidence-pack.json --key cosign.pub --json
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"verified": false,
|
|
96
|
+
"status": "SIGNATURE_MISMATCH",
|
|
97
|
+
"exit_code": 7,
|
|
98
|
+
"schema_version": "1.7",
|
|
99
|
+
"detail": "recomputed canonical bytes do not match the signed digest",
|
|
100
|
+
"verifier_version": "certanix-verify 0.3.0"
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
`exit_code` always equals the process exit code. `verified` is carried explicitly so a
|
|
105
|
+
consumer never has to know that zero means success.
|
|
106
|
+
|
|
107
|
+
## Two modes, deliberately different
|
|
108
|
+
|
|
109
|
+
**Pack mode** (the default) takes the pack JSON and *recomputes* its canonical form. A
|
|
110
|
+
pack that has been re-serialised somewhere in your toolchain — different indentation,
|
|
111
|
+
different key order, same content — still verifies. The signature binds the content, not
|
|
112
|
+
the transport encoding, and reporting a benign JSON round-trip as tampering would be a
|
|
113
|
+
false accusation.
|
|
114
|
+
|
|
115
|
+
**Byte-exact mode** takes a canonical-bytes file and its detached bundle:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
certanix-verify verify evidence-pack.canonical.json --bundle evidence-pack.bundle --key cosign.pub
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Here nothing is recomputed, so **any** byte change fails — including a re-serialisation
|
|
122
|
+
that pack mode accepts. That is the correct behaviour for an archived artifact whose
|
|
123
|
+
exact bytes are the claim. The two modes disagreeing on that one input is by design.
|
|
124
|
+
|
|
125
|
+
**Standalone mode** takes a signed artifact that is not a pack and names its own type in
|
|
126
|
+
`artifact_type`: a delta report or delta refusal, self-evidence, or an EU Control and
|
|
127
|
+
Origin Attestation (`attestation`):
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
certanix-verify verify attestation.json --standalone --key cosign.pub
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
The checks are the same as for a pack (structure, then the signature over the canonical
|
|
134
|
+
bytes recomputed from the document as presented), against that type's bundled schema. An
|
|
135
|
+
unknown or missing `artifact_type` is refused as an unsupported schema, never guessed.
|
|
136
|
+
|
|
137
|
+
## Provenance
|
|
138
|
+
|
|
139
|
+
`VENDORED.json` records where this verifier came from: the platform source file and its
|
|
140
|
+
SHA-256, the platform commit, and the schema version the bundled descriptors were taken
|
|
141
|
+
from. The verification logic here is generated verbatim from the platform's single
|
|
142
|
+
source — it is a copy, never a reimplementation — and the platform's CI asserts that
|
|
143
|
+
this copy and the platform agree on every case in the verification conformance corpus.
|
|
144
|
+
|
|
145
|
+
## Licence
|
|
146
|
+
|
|
147
|
+
BSD-3-Clause-Clear: see [LICENSE](LICENSE). Who holds the copyright, and the assignment
|
|
148
|
+
to come: see [NOTICE](NOTICE). Patents: see [PATENTS-NOTICE.md](PATENTS-NOTICE.md); the
|
|
149
|
+
licence itself grants no patent rights.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"core_version": "1.0.0",
|
|
3
|
+
"edition": "public",
|
|
4
|
+
"generated": {
|
|
5
|
+
"CHANGELOG.md": "aa57279b718e706a779c3e5df0ae92b8240044fdb99c4d2824679d0e7db6756b",
|
|
6
|
+
"LICENSE": "66b5a88341b191fec9ecc379ea660411e2b77b2a69a80022fb7d4aef1852b27f",
|
|
7
|
+
"NOTICE": "8257751cf8316c57d4f49dbcdf79895f97b716ee9598185bc31da22d724953a2",
|
|
8
|
+
"PATENTS-NOTICE.md": "4765a4759ee793aadd848f2342b30e1cc2f3bf059cee0fe2b0f5ab8900a1c286",
|
|
9
|
+
"README.md": "6758f29da92d319d8126687dd560c05082956a24af19883de396d2670c24373a",
|
|
10
|
+
"man/certanix-verify.1": "8b9d643679426be84d69a2fc03ad6431e7174466eb674f6af2b5f4f310eca398",
|
|
11
|
+
"pyproject.toml": "4820237e4f2b9fb67d340d67de03da320b022de70583ced893fd624fe6f402cf",
|
|
12
|
+
"src/certanix_verify/__init__.py": "8f17e2a0e7510d71c8230a5bfca7cfc473b748085ba35f81202435f40994e45f",
|
|
13
|
+
"src/certanix_verify/__main__.py": "f665b4f19dee058ff80cd8a51ef2382f5bfdc04d869e0b246748c1341971ecb9",
|
|
14
|
+
"src/certanix_verify/_core.py": "642afff2966680b9ae18225a6938a67c2408d0151d26fe4cbd9fa3b7a814cc10",
|
|
15
|
+
"src/certanix_verify/_descriptors.py": "1b39eed46c2b18a48fe91d02a77e575690597638bd57174cbcbf72a65833a85c",
|
|
16
|
+
"src/certanix_verify/_vault.py": "e9a80c2ea12de39daaa48b97e3ac512429e4dd35a3acd6653fa7226dc4df84fc",
|
|
17
|
+
"src/certanix_verify/cli.py": "a759727599068a05e05c93d2745f00ca152231a90f93d8b25da802099fccbe5a",
|
|
18
|
+
"src/certanix_verify/descriptors.json": "272e3c5c8411c2413b295c73faffce82229ca8df9bfeaa2287b4a9d92c4b9b35"
|
|
19
|
+
},
|
|
20
|
+
"generator": "tools/vendor_verify_core.py",
|
|
21
|
+
"platform_commit": "4bfed42+dirty",
|
|
22
|
+
"schema_version": "1.13",
|
|
23
|
+
"sources": {
|
|
24
|
+
"certanix/vault_verify.py": "440de5972f4c513092a49434a77b7e6ec5a0312e13387d04bb24d206545e1e4f",
|
|
25
|
+
"certanix/verify_core.py": "08b3e58b5fce466906d0dc97d7bfe20789d84509b1460d2b64134fdcf3c40cc1"
|
|
26
|
+
},
|
|
27
|
+
"version": "0.14.0"
|
|
28
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
.TH CERTANIX-VERIFY 1 "2026-10-13" "certanix-verify 0.14.0" "User Commands"
|
|
2
|
+
.SH NAME
|
|
3
|
+
certanix-verify \- verify a Certanix evidence pack offline
|
|
4
|
+
.SH SYNOPSIS
|
|
5
|
+
.B certanix-verify verify
|
|
6
|
+
.I PACK
|
|
7
|
+
.B \-\-key
|
|
8
|
+
.I PEM
|
|
9
|
+
.RB [ \-\-bundle
|
|
10
|
+
.IR FILE " | " \-\-standalone ]
|
|
11
|
+
.RB [ \-\-json ]
|
|
12
|
+
.br
|
|
13
|
+
.B certanix-verify vault
|
|
14
|
+
.I RECORD
|
|
15
|
+
.B \-\-data
|
|
16
|
+
.I FILE
|
|
17
|
+
.RB [ \-\-data
|
|
18
|
+
.IR FILE ]
|
|
19
|
+
.B \-\-tsa\-root
|
|
20
|
+
.I PEM
|
|
21
|
+
.RB [ \-\-at
|
|
22
|
+
.IR TIME ]
|
|
23
|
+
.RB [ \-\-json ]
|
|
24
|
+
.SH DESCRIPTION
|
|
25
|
+
Verifies that an evidence pack's canonical bytes match the detached signature made by
|
|
26
|
+
the supplied public key, that the pack satisfies the evidence\-pack schema, and that it
|
|
27
|
+
claims no capability its own recorded capability gate denies.
|
|
28
|
+
.PP
|
|
29
|
+
Fully offline: no network, no
|
|
30
|
+
.BR cosign (1)
|
|
31
|
+
binary, no transparency\-log lookup. The only runtime dependency is the
|
|
32
|
+
.B cryptography
|
|
33
|
+
and
|
|
34
|
+
.B asn1crypto
|
|
35
|
+
packages, both pinned.
|
|
36
|
+
.PP
|
|
37
|
+
.B certanix-verify vault
|
|
38
|
+
(0.6.0; renewed records from 0.7.0) checks a Certanix Vault evidence record (RFC 4998)
|
|
39
|
+
over the data objects it covers, every renewal in it, and its RFC 3161 timestamp against the TSA trust anchors supplied, at the time
|
|
40
|
+
given by
|
|
41
|
+
.B \-\-at
|
|
42
|
+
(default now). It shows that the bytes are unchanged since the time the TSA states. It
|
|
43
|
+
does not check revocation, and it says nothing about whether the content is true.
|
|
44
|
+
.PP
|
|
45
|
+
.B certanix-verify
|
|
46
|
+
does not tell you whose key you supplied. Confirm the key's fingerprint against an
|
|
47
|
+
out\-of\-band source before trusting a successful result.
|
|
48
|
+
.SH OPTIONS
|
|
49
|
+
.TP
|
|
50
|
+
.BI \-\-key " PEM"
|
|
51
|
+
Path to the signer's PEM public key. Required. No key is ever guessed: a signature
|
|
52
|
+
checked against an unspecified key proves nothing about who signed it.
|
|
53
|
+
.TP
|
|
54
|
+
.BI \-\-bundle " FILE"
|
|
55
|
+
Treat
|
|
56
|
+
.I PACK
|
|
57
|
+
as a canonical\-bytes file and verify it against this detached signature bundle,
|
|
58
|
+
byte for byte. In this mode nothing is recomputed, so any byte change fails \(em
|
|
59
|
+
including a re\-serialisation that the default mode accepts.
|
|
60
|
+
.TP
|
|
61
|
+
.B \-\-standalone
|
|
62
|
+
Treat
|
|
63
|
+
.I PACK
|
|
64
|
+
as a standalone signed root that names its own type in
|
|
65
|
+
.IR artifact_type :
|
|
66
|
+
a delta report or delta refusal, self\-evidence, or an EU Control and Origin Attestation
|
|
67
|
+
.RI ( attestation ).
|
|
68
|
+
The same checks as a pack, against that root's bundled schema; an unknown type is
|
|
69
|
+
refused as an unsupported schema, never guessed. Cannot be combined with
|
|
70
|
+
.BR \-\-bundle .
|
|
71
|
+
.TP
|
|
72
|
+
.BI \-\-chain " EARLIER"
|
|
73
|
+
With
|
|
74
|
+
.BR \-\-standalone :
|
|
75
|
+
an earlier member of the file's chain, oldest first, repeated for each: the EU Control
|
|
76
|
+
and Origin Attestation an attestation renews. Checks every member and that each names the
|
|
77
|
+
one before it by the digest of its signed bytes, by its valid_from, and for the same legal
|
|
78
|
+
entity.
|
|
79
|
+
.TP
|
|
80
|
+
.B \-\-json
|
|
81
|
+
Emit one JSON object on standard output:
|
|
82
|
+
.IR verified ", " status ", " exit_code ", " schema_version ", " detail ", "
|
|
83
|
+
.IR verifier_version .
|
|
84
|
+
.TP
|
|
85
|
+
.B \-\-version
|
|
86
|
+
Print the version and exit.
|
|
87
|
+
.SH MODES
|
|
88
|
+
By default the canonical form is recomputed from the pack as presented, so a pack
|
|
89
|
+
re\-serialised with different whitespace or key order still verifies: the signature binds
|
|
90
|
+
the content, not the transport encoding. With
|
|
91
|
+
.B \-\-bundle
|
|
92
|
+
the supplied bytes are themselves the claim and any change fails. The two modes
|
|
93
|
+
disagreeing on a benign re\-serialisation is deliberate.
|
|
94
|
+
.SH EXIT STATUS
|
|
95
|
+
The exit status is the verification class, so a script may branch on the reason for
|
|
96
|
+
failure without parsing output.
|
|
97
|
+
.TP
|
|
98
|
+
.B 0
|
|
99
|
+
OK \(em signature valid over the canonical bytes; schema valid; no gate violation.
|
|
100
|
+
.TP
|
|
101
|
+
.B 1
|
|
102
|
+
USAGE \(em could not begin: unreadable pack, missing key, bad invocation. Says nothing
|
|
103
|
+
about the pack.
|
|
104
|
+
.TP
|
|
105
|
+
.B 2
|
|
106
|
+
MALFORMED_INPUT \(em not parseable as a JSON object.
|
|
107
|
+
.TP
|
|
108
|
+
.B 3
|
|
109
|
+
SCHEMA_INVALID \(em parses, but violates the schema. Checks stop at the first failure,
|
|
110
|
+
so this does not mean the signature was valid.
|
|
111
|
+
.TP
|
|
112
|
+
.B 4
|
|
113
|
+
UNSUPPORTED_SCHEMA_VERSION \(em an unknown schema version, refused rather than
|
|
114
|
+
canonicalised under guessed rules.
|
|
115
|
+
.TP
|
|
116
|
+
.B 5
|
|
117
|
+
SIGNATURE_MISSING \(em the pack is unsigned. A distinct state, not a failed check.
|
|
118
|
+
.TP
|
|
119
|
+
.B 6
|
|
120
|
+
SIGNATURE_MALFORMED \(em a signature is present but its container is not decodable.
|
|
121
|
+
.TP
|
|
122
|
+
.B 7
|
|
123
|
+
SIGNATURE_MISMATCH \(em these are not the bytes that were signed. The tamper class.
|
|
124
|
+
.TP
|
|
125
|
+
.B 8
|
|
126
|
+
KEY_MISMATCH \(em the signature names a different signer than the key supplied. Reported
|
|
127
|
+
only when the bundle positively identifies another key; otherwise an ambiguous failure
|
|
128
|
+
is reported as 7 rather than as a more specific accusation.
|
|
129
|
+
.TP
|
|
130
|
+
.B 9
|
|
131
|
+
GATE_VIOLATION \(em signature and schema are valid, but the pack claims a capability its
|
|
132
|
+
recorded gate state denies.
|
|
133
|
+
.TP
|
|
134
|
+
.B 10
|
|
135
|
+
EVIDENCE_MISMATCH \(em
|
|
136
|
+
.B vault
|
|
137
|
+
only: the record does not cover these bytes (they changed after they were timestamped).
|
|
138
|
+
.TP
|
|
139
|
+
.B 11
|
|
140
|
+
TIMESTAMP_INVALID \(em
|
|
141
|
+
.B vault
|
|
142
|
+
only: the RFC 3161 token is not valid (modified, or its signature fails).
|
|
143
|
+
.TP
|
|
144
|
+
.B 12
|
|
145
|
+
TSA_UNTRUSTED \(em
|
|
146
|
+
.B vault
|
|
147
|
+
only: the token's signer does not chain to a supplied trust anchor, is not a
|
|
148
|
+
time\-stamping certificate, or was not valid when the token was issued.
|
|
149
|
+
.TP
|
|
150
|
+
.B 13
|
|
151
|
+
TSA_EXPIRED \(em
|
|
152
|
+
.B vault
|
|
153
|
+
only: the time\-stamping certificate has expired at the verification time and nothing
|
|
154
|
+
in the record renews it.
|
|
155
|
+
.SH FILES
|
|
156
|
+
.TP
|
|
157
|
+
.B VENDORED.json
|
|
158
|
+
Provenance of the bundled verification logic: platform source path and SHA\-256,
|
|
159
|
+
platform commit, and the schema version of the bundled descriptors.
|
|
160
|
+
.SH EXAMPLES
|
|
161
|
+
.PP
|
|
162
|
+
Verify a pack:
|
|
163
|
+
.PP
|
|
164
|
+
.RS
|
|
165
|
+
.nf
|
|
166
|
+
certanix\-verify verify evidence\-pack.json \-\-key cosign.pub
|
|
167
|
+
.fi
|
|
168
|
+
.RE
|
|
169
|
+
.PP
|
|
170
|
+
Verify archived canonical bytes, byte for byte:
|
|
171
|
+
.PP
|
|
172
|
+
.RS
|
|
173
|
+
.nf
|
|
174
|
+
certanix\-verify verify evidence\-pack.canonical.json \\
|
|
175
|
+
\-\-bundle evidence\-pack.bundle \-\-key cosign.pub
|
|
176
|
+
.fi
|
|
177
|
+
.RE
|
|
178
|
+
.PP
|
|
179
|
+
Branch on the failure class:
|
|
180
|
+
.PP
|
|
181
|
+
.RS
|
|
182
|
+
.nf
|
|
183
|
+
certanix\-verify verify pack.json \-\-key cosign.pub \-\-json > result.json
|
|
184
|
+
case $? in
|
|
185
|
+
0) echo verified ;;
|
|
186
|
+
7) echo "content does not match the signature" ;;
|
|
187
|
+
9) echo "pack claims what it is not entitled to claim" ;;
|
|
188
|
+
esac
|
|
189
|
+
.fi
|
|
190
|
+
.RE
|
|
191
|
+
.SH SEE ALSO
|
|
192
|
+
.BR cosign (1)
|
|
193
|
+
.SH NOTES
|
|
194
|
+
Released under BSD\-3\-Clause\-Clear; see LICENSE, NOTICE and PATENTS\-NOTICE.md.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.27"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "certanix-verify"
|
|
7
|
+
version = "0.14.0"
|
|
8
|
+
description = "Offline verification of Certanix evidence packs."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "BSD-3-Clause-Clear"
|
|
12
|
+
license-files = ["LICENSE", "NOTICE", "PATENTS-NOTICE.md"]
|
|
13
|
+
authors = [{ name = "GovStrat SRL" }]
|
|
14
|
+
maintainers = [{ name = "GovStrat SRL" }]
|
|
15
|
+
keywords = ["evidence", "verification", "signature", "ecdsa", "rfc3161"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Operating System :: OS Independent",
|
|
19
|
+
"Topic :: Security :: Cryptography",
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
# Pinned. A verifier whose dependency floats is a verifier whose behaviour can change
|
|
23
|
+
# without anyone deciding that it should.
|
|
24
|
+
dependencies = ["cryptography==48.0.1", "asn1crypto==1.5.1"]
|
|
25
|
+
|
|
26
|
+
[project.urls]
|
|
27
|
+
Homepage = "https://certanix.eu/verify/"
|
|
28
|
+
Schemas = "https://schema.certanix.eu/"
|
|
29
|
+
|
|
30
|
+
[project.scripts]
|
|
31
|
+
certanix-verify = "certanix_verify.cli:main"
|
|
32
|
+
|
|
33
|
+
[tool.hatch.build.targets.wheel]
|
|
34
|
+
packages = ["src/certanix_verify"]
|
|
35
|
+
|
|
36
|
+
[tool.hatch.build.targets.sdist]
|
|
37
|
+
only-include = ["src/certanix_verify", "README.md", "CHANGELOG.md", "VENDORED.json", "man", "LICENSE", "NOTICE", "PATENTS-NOTICE.md"]
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# GENERATED FILE. DO NOT EDIT.
|
|
2
|
+
#
|
|
3
|
+
# The public build of packages/certanix-verify/src/certanix_verify/__init__.py,
|
|
4
|
+
# generated by tools/vendor_verify_core.py. Edit the SOURCE and re-run the generator.
|
|
5
|
+
|
|
6
|
+
"""certanix-verify — offline verification of Certanix evidence packs.
|
|
7
|
+
|
|
8
|
+
Self-contained: the standard library plus ``cryptography``. No network, no cosign
|
|
9
|
+
binary, no transparency-log lookup, nothing from the Certanix platform at runtime.
|
|
10
|
+
|
|
11
|
+
The verification logic in ``_core`` is vendored verbatim from the platform's
|
|
12
|
+
``certanix/verify_core.py`` by a generator, and the schema/gate data in
|
|
13
|
+
``descriptors.json`` is serialised from the platform's live models and registries. CI
|
|
14
|
+
asserts both are current and that this verifier agrees with the platform's on every
|
|
15
|
+
case in the conformance corpus. There is one implementation; this is its copy.
|
|
16
|
+
|
|
17
|
+
VERIFICATION SCOPE: this checks that the pack's canonical bytes match the detached
|
|
18
|
+
signature made by the key you supply. It does not tell you whose key that is. Confirm
|
|
19
|
+
the key's fingerprint against an out-of-band source before trusting what it says.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
from __future__ import annotations
|
|
23
|
+
|
|
24
|
+
__version__ = "0.14.0"
|
|
25
|
+
|
|
26
|
+
from ._core import ( # noqa: F401
|
|
27
|
+
VerificationResult,
|
|
28
|
+
VerificationStatus,
|
|
29
|
+
canonical_pack_bytes,
|
|
30
|
+
verify_canonical_bytes,
|
|
31
|
+
verify_pack_bytes,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
__all__ = [
|
|
35
|
+
"__version__",
|
|
36
|
+
"VerificationResult",
|
|
37
|
+
"VerificationStatus",
|
|
38
|
+
"canonical_pack_bytes",
|
|
39
|
+
"verify_canonical_bytes",
|
|
40
|
+
"verify_pack_bytes",
|
|
41
|
+
]
|