RFC PV-PROOF-001 : ProbatioVault ProofEnvelope Protocol¶
Statut : Proposition interne Version : 1.2.0 Date : 2026-03-02 Auteur : ProbatioVault Engineering Verification formelle : TLA+ (TLC), Alloy (SAT), Z Notation, Prolog Revision : 1.2.0 — resolution conflit PENDING/immutabilite, nommage seal unifie, schema canonique, statut agrege, politique de confiance offline, niveaux de preuve formelle
1. Introduction¶
1.1 Objectif¶
Ce document specifie le protocole PV ProofEnvelope, le format standard de preuve composite ProbatioVault. Une ProofEnvelope assemble toutes les evidences cryptographiques et legales necessaires pour prouver, de maniere independante et offline, qu'un acces legal a un document chiffre a ete realise conformement au protocole.
1.2 Portee¶
Ce protocole couvre :
- La structure canonique de la preuve composite (5 sections d'evidence)
- La chaine de preuve a 4 maillons (document hash, Merkle proof, TSA timestamp, blockchain anchor)
- La procedure de verification offline (sans acces ProbatioVault)
- L'immutabilite apres generation
- Le materiel de verification inclus dans la preuve
- L'absence de secrets cryptographiques dans la preuve
1.3 References normatives¶
| Reference | Titre | Usage |
|---|---|---|
| PV-ENV-001 | ProbatioVault Envelope Protocol | Hierarchie de cles, HSM signing |
| PV-PRE-001 | ProbatioVault PRE Protocol | Lifecycle ReKey, evidence PRE |
| PV-AUDIT-001 | ProbatioVault Audit Protocol | Format events audit, pipeline probatif |
| PV-ANCHOR-001 | ProbatioVault Anchor Protocol | Batch lifecycle, Merkle proofs |
| RFC 3161 | Internet X.509 PKI TSP | Tokens d'horodatage |
| RFC 8785 | JCS (JSON Canonicalization Scheme) | Serialisation canonique |
| RFC 5280 | Internet X.509 PKI Certificate and CRL Profile | Validation certificats, chaines de confiance |
1.4 Terminologie¶
| Terme | Definition |
|---|---|
| ProofEnvelope | Structure composite contenant 5 sections d'evidence, verifiable offline. Immutable apres generation. |
| Evidence Section | Une des 5 sections obligatoires de la preuve : mandat, double validation, lifecycle ReKey, audit, ancrage. |
| Chain Link | Un des 4 maillons de la chaine de preuve : document hash, Merkle proof, TSA timestamp, blockchain anchor. |
| CheckResult | Resultat de verification d'un maillon : OK, KO, ou INDETERMINATE (etats terminaux). PENDING est un etat pre-finalisation uniquement. |
| Verification Material | Materiel inclus dans la preuve pour permettre la verification offline : label cle HSM, algorithme de hash, algorithme de signature, cle publique, chaine de certificats. |
| Merkle Proof | Preuve d'inclusion d'un event dans un arbre de Merkle, au format defini par PV-ANCHOR-001. Structure : leaf hash, leaf index, sibling hashes (co-path), Merkle root. |
2. Vue d'ensemble du protocole¶
2.1 Structure de la ProofEnvelope¶
+----------------------------------------------------------------------+
| ProofEnvelope v1 |
| proofId: UUID |
| mandateId: UUID |
| version: "1.0.0" |
| generatedAt: ISO 8601 UTC |
+----------------------------------------------------------------------+
| |
| +------------------+ +------------------+ +--------------------+ |
| | 1. Mandate | | 2. Dual | | 3. ReKey | |
| | Evidence | | Validation | | Lifecycle | |
| | | | Evidence | | Evidence | |
| | - eIDAS mandate | | - DPO approval | | - generation | |
| | - TSP verify | | - Legal approval | | - re-encryptions | |
| | - certificate | | - timestamps | | - terminal state | |
| +------------------+ +------------------+ | - destruction | |
| +--------------------+ |
| +------------------+ +------------------+ |
| | 4. Audit Log | | 5. Anchoring | |
| | Evidence | | Evidence | |
| | | | | |
| | - signed events | | - Merkle leaves | |
| | - SHA3 hashes | | - batch refs | |
| | - HSM sigs | | - tx hashes | |
| | - TSA token refs | | - block numbers | |
| +------------------+ +------------------+ |
| |
| +--------------------------------------------------------------+ |
| | Verification Material | |
| | - HSM key label (pv-master-signing-*) | |
| | - Hash algorithm (SHA3-256) | |
| | - Signature algorithm (ECDSA_SHA384 / P-384) | |
| | - Public key (SPKI/DER) | |
| +--------------------------------------------------------------+ |
| |
| +--------------------------------------------------------------+ |
| | 4-Link Chain Verification | |
| | [Document Hash] -> [Merkle Proof] -> [TSA Token] -> [Anchor] | |
| | OK/KO OK/KO OK/KO OK/KO | |
| +--------------------------------------------------------------+ |
| |
| +--------------------------------------------------------------+ |
| | Envelope Seal (PROOF-14) | |
| | - canonicalHash: SHA3-256(JCS(envelope)) | |
| | - signature: ECDSA P-384(canonicalHash) | |
| | - certificateChain: [HSM cert + intermediaires] | |
| +--------------------------------------------------------------+ |
+----------------------------------------------------------------------+
2.2 Flux de generation¶
- InitiateProof : Creation avec mandateId, sections vides
- AttachMandateEvidence : Evidence du mandat eIDAS + verification TSP
- AttachValidationEvidence : Evidence de la double validation (DPO + Legal)
- AttachReKeyEvidence : Evidence du lifecycle ReKey (precondition : aucun ReKey ACTIVE)
- AttachAuditEvidence : Events audit signes (SHA3 + HSM + TSA refs)
- AttachAnchoringEvidence : Merkle leaves + batch refs + blockchain refs
- FinalizeProof : Verification completude (5 sections non-vides) + immutabilite
2.3 Propriete d'independance¶
EXIGENCE PROOF-09 : La ProofEnvelope DOIT etre verifiable de maniere independante, sans acces a ProbatioVault. Deux niveaux de verification sont definis :
| Niveau | Perimetre | Prerequis externes | Maillons couverts |
|---|---|---|---|
| Offline strict | Verification cryptographique interne : hashes, signatures HSM, coherence Merkle proof vs Merkle root, validation TSA token, coherence structurelle | Aucun (air-gapped) | 1 (Document Hash), 2 (Merkle Proof), 3 (TSA Token) |
| Offline + source publique | Verification ancrage blockchain : confirmation transaction, statut batch FINALIZED | Acces a une source blockchain publique (noeud, explorer, archive de block headers) — independance a ProbatioVault mais pas air-gapped | 4 (Blockchain Anchor) |
Le maillon 4 (Blockchain Anchor) ne peut pas etre verifie en mode air-gapped strict. La ProofEnvelope inclut les references necessaires (tx hash, block number, batch ID) mais la confirmation requiert l'acces a la blockchain publique. Un verificateur offline strict DOIT traiter le maillon 4 comme INDETERMINATE s'il n'a pas acces a une source blockchain.
Pour les maillons 1 a 3, toutes les donnees necessaires (cle publique, hashes, signatures, algorithmes, certificats) sont incluses dans la preuve.
3. Specifications detaillees¶
3.1 Sections d'evidence¶
EXIGENCE PROOF-01 : Une ProofEnvelope DOIT contenir exactement 5 sections d'evidence. Prouve formellement (TLA+ INV-02 FiveSectionsComplete, Alloy EveryProofHasFiveSections).
| Section | Contenu | Source |
|---|---|---|
| 1. Mandate Evidence | Mandat eIDAS, verification TSP, certificat electronique | buildMandateEvidence() |
| 2. Validation Evidence | Approbation DPO, approbation autorite legale, horodatages | buildDoubleValidationEvidence() |
| 3. ReKey Lifecycle | Generation, re-chiffrements, etat terminal, destruction | buildReKeyLifecycleEvidence() |
| 4. Audit Log Evidence | Events signes : SHA3 hash + HSM signature + ref TSA token | buildAuditLogEvidence() |
| 5. Anchoring Evidence | Merkle leaf refs + batch refs + tx hashes + block numbers | buildAnchoringEvidence() |
EXIGENCE PROOF-03 : Chaque section DOIT etre non-vide pour qu'une preuve soit finalisable. Prouve formellement (TLA+ FinalizeProof precondition).
3.2 Precondition ReKey¶
EXIGENCE PROOF-02 : Au moment de la generation de la preuve, il NE DOIT PAS y avoir de ReKey a l'etat ACTIVE pour le mandat concerne. Tous les ReKeys doivent avoir atteint un etat terminal (REVOKED, EXPIRED, COMPLETED) ou DESTROYED. Prouve formellement (TLA+ INV-03 NoActiveReKeys, Alloy NoActiveReKeysInProof).
3.3 Versioning¶
EXIGENCE PROOF-04 : Chaque ProofEnvelope possede une version. La version est immutable apres generation. Prouve formellement (TLA+ INV-05 VersionPresent).
3.4 Materiel de verification¶
EXIGENCE PROOF-05 : Toute ProofEnvelope finalisee DOIT inclure le materiel de verification :
| Champ | Description | Format |
|---|---|---|
hsmKeyLabel | Label de la cle HSM utilisee pour signer | pv-master-signing-* |
hashAlgorithm | Algorithme de hash des events audit | SHA3-256 |
signatureAlgorithm | Algorithme de signature HSM | ECDSA_SHA384 (P-384) |
publicKey | Cle publique pour verification offline | SPKI/DER |
EXIGENCE PROOF-05b : Pour la verification offline des certificats eIDAS et TSA, la ProofEnvelope DOIT inclure le materiel de validation au moment de la generation :
| Champ | Description | Format |
|---|---|---|
tsaCertificateChain | Chaine de certificats de l'autorite d'horodatage | PEM array |
eidasCertificateChain | Chaine de certificats du mandat eIDAS | PEM array |
ocspResponses | Reponses OCSP stapled au moment de la generation | DER Base64 array |
relevantCrls | CRLs pertinentes au moment de la generation (si OCSP indisponible) | DER Base64 array |
validationTimestamp | Instant T de la validation des certificats | ISO 8601 UTC |
Strategie de validation a l'instant T : Les reponses OCSP et/ou CRLs sont capturees au moment de la generation de la preuve (validationTimestamp). Elles attestent que les certificats n'etaient pas revoques a cet instant. Un verificateur offline utilise ces preuves de non-revocation embarquees au lieu de contacter les serveurs OCSP/CRL.
Prouve formellement (TLA+ INV-06 VerificationMaterialPresent, Alloy VerificationMaterialComplete).
3.5 Evidence audit¶
EXIGENCE PROOF-06 : Chaque event audit reference dans la preuve DOIT inclure : - Le hash SHA3-256 du contenu canonique (RFC 8785) - La signature HSM ECDSA P-384 - La reference au token TSA (RFC 3161)
Prouve formellement (TLA+ INV-08 AuditEventsHaveSignatures, Alloy AuditEventsHaveCryptoBinding).
3.6 Evidence ancrage¶
EXIGENCE PROOF-07 : L'evidence d'ancrage DOIT inclure, pour chaque event ancre : - La reference au leaf Merkle (leaf hash + leaf index) - La reference au batch d'ancrage (batch ID) - Le hash de la transaction blockchain - Le numero de bloc
Prouve formellement (Alloy AnchoringRefsValid).
3.7 Chaine de preuve (4 maillons)¶
EXIGENCE PROOF-08 : La ProofEnvelope DOIT verifier les 4 maillons de la chaine de preuve. Chaque maillon a un statut explicite :
| Maillon | Verification | Resultat (post-finalisation) | Niveau |
|---|---|---|---|
| 1. Document Hash | SHA3-256 du document vs hash stocke | OK / KO / INDETERMINATE | Offline strict |
| 2. Merkle Proof | Inclusion proof PV-ANCHOR-001 vs Merkle root | OK / KO / INDETERMINATE | Offline strict |
| 3. TSA Timestamp | Token RFC 3161 valide | OK / KO / INDETERMINATE | Offline strict |
| 4. Blockchain Anchor | Transaction confirmee, batch FINALIZED (requiert source publique) | OK / KO / INDETERMINATE | Offline + source publique |
Prouve formellement (TLA+ INV-04 ChainLinkExplicit, Alloy AllChainLinksExplicit).
3.7.1 Etats de verification et finalisation (PD-280)¶
Les resultats de verification d'un maillon suivent une machine a etats stricte :
| Etat | Semantique | Terminal | Exemple |
|---|---|---|---|
| PENDING | Verification en cours, resolution attendue dans un delai borne (SLA) | Non — pre-finalisation uniquement | Batch blockchain en PENDING_FINALITY, transaction en attente de confirmations |
| OK | Verification reussie | Oui | Hash document valide, Merkle proof correct |
| KO | Verification echouee | Oui | Hash mismatch, signature invalide |
| INDETERMINATE | Impossible de conclure la verification | Oui | Blockchain inaccessible, donnees corrompues |
EXIGENCE PROOF-15 : FinalizeProof DOIT verifier que les 4 maillons de la chaine sont dans un etat terminal {OK, KO, INDETERMINATE}. Si un maillon est a l'etat PENDING, la finalisation DOIT etre refusee. Cette exigence garantit que le scellement (PROOF-14) porte toujours sur un artefact dont l'etat ne changera plus.
Consequence : l'etat PENDING est un etat pre-finalisation uniquement. L'artefact ProofEnvelope persiste et scelle ne contient jamais PENDING. En API, la valeur null dans linkResults signifie "preuve non encore finalisee" (en cours de construction).
EXIGENCE PROOF-15a : Le pendingResolutionTtl definit le delai maximum avant qu'un maillon PENDING soit reclassifie en INDETERMINATE (defaut 72h, bornes [1h, 30j]). Cette reclassification a lieu en amont de la finalisation — elle est une precondition, pas une modification post-seal.
Regles de transition : - PENDING -> OK | KO | INDETERMINATE : autorise (resolution du maillon, avant finalisation) - PENDING -> INDETERMINATE (SLA) : si pendingResolutionTtl depasse, reclassification automatique - OK | KO | INDETERMINATE -> * : interdit (etats terminaux, monotonie stricte) - FinalizeProof : refuse si un maillon est PENDING (PROOF-15)
3.8 Timestamp¶
EXIGENCE PROOF-10 : Le timestamp de generation (generatedAt) DOIT etre au format ISO 8601 UTC.
3.9 Absence de secrets¶
EXIGENCE PROOF-11 : La ProofEnvelope NE DOIT contenir AUCUN secret cryptographique. Seuls les elements publics sont inclus : cles publiques, hashes, signatures, certificats, references. Prouve formellement (TLA+ INV-09 NoSecretsInProof, Alloy NoSecretsLeaked).
3.10 Immutabilite¶
EXIGENCE PROOF-12 : Une ProofEnvelope persistee est immutable. Aucune modification n'est autorisee apres persistance (enforced par trigger PostgreSQL BEFORE UPDATE OR DELETE). Prouve formellement (TLA+ INV-07 ImmutableAfterFinalize, Alloy ImmutableAfterGeneration).
3.11 Audit trail¶
EXIGENCE PROOF-13 : Chaque generation de preuve DOIT etre tracee dans l'audit trail (PV-AUDIT-001). L'audit log est append-only. Prouve formellement (TLA+ INV-10 AuditAppendOnly).
3.12 Scellement cryptographique de l'enveloppe¶
EXIGENCE PROOF-14 : Toute ProofEnvelope finalisee DOIT etre scellee par une signature HSM portant sur sa serialisation canonique. Ce scellement garantit qu'un tiers peut verifier l'integrite de l'enveloppe exportee sans acces a ProbatioVault.
Procedure de scellement :
- Serialisation canonique :
envelopeCanonical = JCS(proofEnvelope sans envelopeSeal)(RFC 8785). Le champenvelopeSealdans son integralite est exclu de la canonicalisation. Aucun autre champ n'est exclu. - Hash :
sealHash = SHA3-256(envelopeCanonical) - Signature :
sealSignature = ECDSA_P384(sealHash, hsmPrivateKey) - Inclusion : Le hash, la signature et la chaine de certificats publique sont ajoutes a l'enveloppe dans le champ
envelopeSeal.
| Champ | Description | Format |
|---|---|---|
envelopeSeal.canonicalHash | Hash SHA3-256 de la serialisation JCS | Hex string (64 chars) |
envelopeSeal.signature | Signature ECDSA P-384 du hash | Base64 DER |
envelopeSeal.certificateChain | Chaine de certificats (cle publique HSM + intermediaires) | PEM array |
envelopeSeal.algorithm | Algorithme de signature | ECDSA_SHA384 |
envelopeSeal.timestamp | Horodatage du scellement | ISO 8601 UTC |
Verification par un tiers : Recalculer JCS(envelope sans envelopeSeal), hasher en SHA3-256, verifier la signature avec la cle publique de la chaine de certificats. Prouve formellement (TLA+ INV-11 EnvelopeSealValid, Alloy EnvelopeSealIntegrity, Z INV-11).
3.13 Schema canonique de la ProofEnvelope¶
EXIGENCE PROOF-18 : La ProofEnvelope DOIT respecter le schema JSON suivant. Les champs marques "requis" DOIVENT etre presents dans toute ProofEnvelope finalisee. Les noms de champs sont normatifs et ne DOIVENT PAS varier entre implementations.
| Champ | Type | Requis | Description |
|---|---|---|---|
proofId | UUID (string) | oui | Identifiant unique de la preuve |
mandateId | UUID (string) | oui | Identifiant du mandat legal |
version | string (semver) | oui | Version du protocole ProofEnvelope |
generatedAt | string (ISO 8601 UTC) | oui | Horodatage de generation |
mandateEvidence | object | oui | Section 1 : evidence du mandat eIDAS |
validationEvidence | object | oui | Section 2 : evidence de la double validation |
rekeyLifecycleEvidence | object | oui | Section 3 : evidence du lifecycle ReKey |
auditLogEvidence | array[object] | oui | Section 4 : events audit signes |
anchoringEvidence | array[object] | oui | Section 5 : references d'ancrage |
verificationMaterial | object | oui | Materiel de verification (PROOF-05) |
validationMaterial | object | oui | Materiel de validation eIDAS (PROOF-05b) |
chainLinkResults | object | oui | Resultats des 4 maillons (PROOF-08) |
chainLinkResults.documentHash | enum | oui | Maillon 1 |
chainLinkResults.merkleProof | enum | oui | Maillon 2 |
chainLinkResults.tsaTimestamp | enum | oui | Maillon 3 |
chainLinkResults.blockchainAnchor | enum | oui | Maillon 4 |
aggregateStatus | enum | oui | Statut agrege (PROOF-16) |
envelopeSeal | object | oui | Scellement HSM (PROOF-14) |
Les encodages sont : UUID en string RFC 4122 lowercase, dates en ISO 8601 UTC avec Z suffixe, hashes en hex lowercase, signatures en Base64 standard (RFC 4648 §4), certificats en PEM, cles publiques en SPKI/DER Base64.
3.14 Statut agrege de verification¶
EXIGENCE PROOF-16 : Le statut agrege de la ProofEnvelope est determine par les resultats des 4 maillons :
| Statut agrege | Condition | Semantique |
|---|---|---|
| VALID | Les 4 maillons sont OK | Preuve integralement verifiee |
| PARTIAL | Au moins un maillon OK, aucun KO, un ou plusieurs INDETERMINATE | Preuve partiellement verifiable |
| INVALID | Au moins un maillon KO | Preuve invalide — au moins une verification a echoue |
Le statut agrege est calcule au moment de la finalisation et inclus dans l'artefact scelle. Prouve formellement (INV-14 AggregateStatusConsistent).
3.15 Politique de confiance pour verification offline¶
EXIGENCE PROOF-17 : La ProofEnvelope DOIT inclure les informations necessaires pour qu'un verificateur offline puisse etablir une chaine de confiance complete. Les regles de verification sont :
- Trust anchors : les certificats racines admis pour la verification des chaines eIDAS et TSA DOIVENT etre documentes dans la politique de confiance de ProbatioVault (document separe, reference par URL ou identifiant dans la ProofEnvelope).
- Validation temporelle : le
validationTimestamp(PROOF-05b) est la reference temporelle pour la verification des certificats. Un certificat est considere valide s'il n'etait pas revoque a cet instant. - Resolution OCSP/CRL : si les reponses OCSP et les CRL embarquees divergent sur le statut de revocation d'un certificat, la source la plus recente (par
thisUpdate/lastUpdate) prevaut. - Expiration des preuves de non-revocation : si les reponses OCSP et les CRL embarquees sont toutes expirees (au regard du
validationTimestamp), le resultat de verification du certificat concerne est INDETERMINATE. - Absence de materiel : si le materiel de validation (PROOF-05b) est absent ou incomplet, la verification des certificats est INDETERMINATE.
4. Modele formel¶
4.1 Etats et transitions¶
Le protocole est modelise comme un systeme a etats avec 8 actions :
InitiateProof -----> AttachMandateEvidence -----> AttachValidationEvidence
|
AttachReKeyEvidence <----------------+
|
AttachAuditEvidence
|
AttachAnchoringEvidence
|
FinalizeProof -----> VerifyChainLink (x4)
| Action | Preconditions | Postconditions |
|---|---|---|
| InitiateProof(id, mandateId) | id n'existe pas | proof cree, sections vides, audit event |
| AttachMandateEvidence(id) | proof existe, section mandate vide | section mandate remplie |
| AttachValidationEvidence(id) | proof existe, section validation vide | section validation remplie |
| AttachReKeyEvidence(id) | proof existe, section rekey vide, aucun ReKey ACTIVE | section rekey remplie |
| AttachAuditEvidence(id) | proof existe, section audit vide | section audit remplie (events signes) |
| AttachAnchoringEvidence(id) | proof existe, section anchoring vide | section anchoring remplie |
| FinalizeProof(id) | proof existe, 5 sections non-vides, non finalise, 4 maillons dans {OK,KO,INDETERMINATE} | proof finalise, scelle, immutable, aggregateStatus calcule |
| VerifyChainLink(id, linkType) | proof finalise | chain link verifie (OK/KO/INDETERMINATE) |
4.2 Invariants de surete¶
Niveaux de preuve :
| Niveau | Description |
|---|---|
| Universel | Theoreme TLA+ prouve par induction (non borne) |
| Borne | Model checking TLC (espace d'etats explore exhaustivement dans les bornes) |
| Structurel | Assertion Alloy (SAT, scope fini) ou schema Z |
| Code | Ancrage Prolog (facts extraits du code reel) |
| ID | Invariant | Description | Preuve | Niveau |
|---|---|---|---|---|
| INV-01 | TypeInvariant | Types corrects pour toutes les variables | TLC | Borne |
| INV-02 | FiveSectionsComplete | Preuve finalisee a 5 sections non-vides | TLC + Alloy | Borne + Structurel |
| INV-03 | NoActiveReKeys | Evidence ReKey => pas de ReKey ACTIVE | TLC + Alloy | Borne + Structurel |
| INV-04 | ChainLinkExplicit | Chaque maillon a OK/KO/INDETERMINATE | TLC + Alloy | Borne + Structurel |
| INV-05 | VersionPresent | Chaque preuve a une version | TLC | Borne |
| INV-06 | VerificationMaterialPresent | Preuve finalisee a key+algo | TLC + Alloy | Borne + Structurel |
| INV-07 | ImmutableAfterFinalize | Pas de modification post-finalisation | TLC + Alloy | Borne + Structurel |
| INV-08 | AuditEventsHaveSignatures | Events audit ont SHA3 + HSM sig | TLC + Alloy | Borne + Structurel |
| INV-09 | NoSecretsInProof | Jamais de cle privee dans la preuve | TLC + Alloy | Borne + Structurel |
| INV-10 | AuditAppendOnly | Audit log ne perd jamais d'entrees | TLC | Borne |
| INV-11 | EnvelopeSealValid | Signature HSM de l'enveloppe valide apres finalisation | TLC + Alloy + Z | Borne + Structurel |
| INV-12 | OfflineVerificationMaterialSufficient | Toutes les cles publiques, certificats, OCSP, algos, encodages inclus | TLC + Alloy + Z | Borne + Structurel |
| INV-13 | PendingFreeAtFinalize | Preuve finalisee n'a aucun maillon PENDING | TLC + Alloy | Borne + Structurel |
| INV-14 | AggregateStatusConsistent | Statut agrege coherent avec les 4 maillons | TLC + Alloy | Borne + Structurel |
Note sur TLC : Le model checking utilise une configuration bornee (MAX_PROOFS=2, MAX_SECTIONS=5, MAX_ITERATIONS=12). La verification TLC est bornee : elle explore exhaustivement l'espace d'etats dans ces limites. Des garanties complementaires proviennent des assertions structurelles Alloy (scope 5, solveur SAT) et des schemas Z (invariants universels). Les theoremes TLA+ (THM-01 a THM-10) fournissent des preuves par induction non bornees.
4.3 Theoremes prouves¶
- THM-01 :
Spec => []TypeInvariant - THM-02 :
Spec => []FiveSectionsComplete - THM-03 :
Spec => []NoActiveReKeys - THM-04 :
Spec => []ChainLinkExplicit - THM-05 :
Spec => []VerificationMaterialPresent - THM-06 :
Spec => []ImmutableAfterFinalize - THM-07 :
Spec => []NoSecretsInProof - THM-08 :
Spec => []AuditAppendOnly - THM-09 :
Spec => []PendingFreeAtFinalize - THM-10 :
Spec => []AggregateStatusConsistent
4.4 Assertions structurelles (Alloy)¶
| Assertion | Propriete | Resultat |
|---|---|---|
| EveryProofHasFiveSections | 5 sections obligatoires | UNSAT (prouve) |
| NoActiveReKeysInProof | Pas de ACTIVE dans evidence ReKey | UNSAT (prouve) |
| AllChainLinksExplicit | 4 maillons avec statut explicite | UNSAT (prouve) |
| VersionAlwaysPresent | Version toujours presente | UNSAT (prouve) |
| VerificationMaterialComplete | Materiel complet (key + algos) | UNSAT (prouve) |
| AuditEventsHaveCryptoBinding | Hash + signature pour chaque event | UNSAT (prouve) |
| NoSecretsLeaked | Aucun secret dans la preuve | UNSAT (prouve) |
| ImmutableAfterGeneration | Immutable apres finalisation | UNSAT (prouve) |
| AnchoringRefsValid | References ancrage valides | UNSAT (prouve) |
| EnvelopeSealIntegrity | Scellement HSM present et valide apres finalisation | UNSAT (prouve) |
| OfflineVerificationMaterialSufficient | Materiel suffisant pour verification offline (cles, certs, OCSP, algos) | UNSAT (prouve) |
| PendingFreeAtFinalize | Preuve finalisee n'a aucun maillon PENDING | UNSAT (prouve) |
| AggregateStatusConsistent | Statut agrege coherent avec les 4 maillons | UNSAT (prouve) |
5. Considerations de securite¶
5.1 Modele de menace¶
| Menace | Mitigation | Verification |
|---|---|---|
| Fabrication de preuve | Signatures HSM non falsifiables | PROOF-06, INV-08 |
| Modification post-generation | Immutabilite (trigger DB) | PROOF-12, INV-07 |
| Preuve incomplete | 5 sections obligatoires | PROOF-01, INV-02 |
| ReKey actif au moment de la preuve | Precondition no-ACTIVE | PROOF-02, INV-03 |
| Verification impossible offline | Materiel de verification inclus | PROOF-05, PROOF-09 |
| Fuite de secrets | Aucun secret dans la preuve | PROOF-11, INV-09 |
| Maillon non verifie | Statut explicite par maillon | PROOF-08, INV-04 |
| Tampering audit events | Hash + signature + TSA | PROOF-06, PV-AUDIT-001 |
| Tampering enveloppe exportee | Scellement cryptographique HSM (JCS + ECDSA P-384) | PROOF-14, INV-11 |
| Finalisation avec maillon non resolu | Resolution obligatoire avant finalisation | PROOF-15, INV-13 |
| Interpretation divergente du statut | Statut agrege normatif (VALID/PARTIAL/INVALID) | PROOF-16, INV-14 |
| Verificateur offline sans trust anchors | Politique de confiance documentee + materiel embarque | PROOF-17, PROOF-05b |
5.2 Limitations connues¶
- La preuve ne contient pas le contenu du document lui-meme, seulement son hash. La verification du maillon 1 (Document Hash) necessite l'acces au document original.
- Le statut INDETERMINATE pour un maillon ne constitue pas une preuve d'integrite. Il indique une incapacite temporaire a verifier (ex: blockchain inaccessible).
- La cle publique incluse dans la preuve doit correspondre a la cle HSM au moment de la signature. Si la cle HSM a ete tournee entre-temps, la verification offline reste possible mais necessite la cle publique historique.
6. Ancrage au code reel¶
| Systeme | Mecanisme d'ancrage | Verification |
|---|---|---|
| TLA+ | ASSUME verifiant les sections du code | Echec TLC si divergence |
| Alloy | one sig Real_* + fact some Real_* | Echec SAT si artefact manquant |
| Z | Schemas valides contre entities TypeORM | Lint FAIL si non matche |
| Prolog | Facts extraits du code vs 24 regles de conformite | Checks code reel |
6.1 Etat d'implementation¶
| Composant | Statut | Checks Prolog |
|---|---|---|
| LegalCompositeProofService.generateProof() | Implemente | 2/2 PASS |
| LegalCompositeProofService.verifyProofIntegrity() | Implemente | 1/1 PASS |
| legal_composite_proof entity | Implemente | 6/6 PASS |
| ArchiveChainVerifierService | Implemente | 3/3 PASS |
| AuditVerificationService | Implemente | 4/4 PASS |
| InclusionProofService | Implemente | 3/3 PASS |
| Trigger immutabilite | Implemente | 1/1 PASS |
| HSM FIPS cluster | Implemente | 1/1 PASS |
7. Annexes¶
7.1 Specifications formelles associees¶
| Fichier | Systeme | Contenu |
|---|---|---|
PV_Proof.tla | TLA+ | Modele temporel (9 actions, 12 invariants, 10 theoremes) |
PV_Proof.cfg | TLA+ | Configuration TLC (MAX_PROOFS=2, MAX_SECTIONS=5) |
PV_Proof.als | Alloy | Modele structurel (14 signatures, 11 assertions) |
PV_Proof.zed | Z | Specification ensembliste (16 invariants, 11 theoremes, 6 operations) |
pv_proof_compliance.pl | Prolog | 29 regles de conformite code |
7.2 Matrice de tracabilite¶
| Exigence | TLA+ | Alloy | Z | Prolog |
|---|---|---|---|---|
| PROOF-01 (5 sections) | INV-02 | EveryProofHasFiveSections | INV-02 | check_mandate_evidence_col..check_anchoring_evidence_col |
| PROOF-02 (no ACTIVE) | INV-03 | NoActiveReKeysInProof | INV-03 | check_proof_generate |
| PROOF-03 (non-vide) | INV-02 + FinalizeProof | EveryProofHasFiveSections | INV-02 | check_proof_verify |
| PROOF-04 (version) | INV-05 | VersionAlwaysPresent | INV-05 | check_proof_version_col |
| PROOF-05 (verif material) | INV-06 | VerificationMaterialComplete | INV-06 | check_verification_material_col |
| PROOF-06 (audit sigs) | INV-08 | AuditEventsHaveCryptoBinding | INV-08 | check_audit_log_entity |
| PROOF-07 (anchoring refs) | AttachAnchoringEvidence | AnchoringRefsValid | INV-07 | check_anchoring_evidence_col |
| PROOF-08 (chain links) | INV-04 | AllChainLinksExplicit | INV-04 | check_chain_verifier_service |
| PROOF-09 (offline) | VerifyChainLink | OfflineVerificationMaterialSufficient | INV-12 | check_audit_export_proof |
| PROOF-10 (timestamp) | — | — | INV-10 | — |
| PROOF-11 (no secrets) | INV-09 | NoSecretsLeaked | INV-11 | check_audit_verify_proof |
| PROOF-12 (immutable) | INV-07 | ImmutableAfterGeneration | INV-12 | check_proof_immutable_trigger |
| PROOF-05b (eIDAS material) | INV-12 | OfflineVerificationMaterialSufficient | INV-12 | check_eidas_material_col |
| PROOF-14 (envelope seal) | INV-11 | EnvelopeSealIntegrity | INV-11 | check_envelope_seal_col, check_seal_method, check_jcs_service |
| PROOF-15 (pending-free finalize) | INV-13 | PendingFreeAtFinalize | — | — |
| PROOF-15a (pending resolution TTL) | — | — | — | — |
| PROOF-16 (statut agrege) | INV-14 | AggregateStatusConsistent | — | — |
| PROOF-17 (politique de confiance) | — | — | — | — |
| PROOF-18 (schema canonique) | — | — | — | — |
7.3 Vecteurs de test¶
| Test | Entree | Sortie attendue |
|---|---|---|
| Proof complet | 5 sections remplies | FinalizeProof OK |
| Section manquante | ⅘ sections | FinalizeProof ERREUR |
| ReKey ACTIVE | ReKey status=ACTIVE | AttachReKeyEvidence ERREUR |
| Chain link verifie | Document hash valide | VerifyChainLink OK |
| Chain link echoue | Hash mismatch | VerifyChainLink KO |
| Chain link indetermine | Blockchain inaccessible | VerifyChainLink INDETERMINATE |
| Immutabilite | UPDATE apres finalize | ERREUR (trigger DB) |
| Pas de secrets | Chercher cle privee dans proof | NOT FOUND |
| Verification offline | Proof exporte + cle publique | Verification OK |
| Scellement enveloppe | Proof finalisee | envelopeSeal present, signature valide |
| Scellement tampered | Modifier 1 byte post-seal | Verification signature KO |
| Verification offline strict (maillon 4) | Proof sans acces blockchain | Maillon 4 = INDETERMINATE |
| Finalisation avec PENDING | 1 maillon PENDING | FinalizeProof ERREUR (PROOF-15) |
| Statut agrege VALID | 4 maillons OK | aggregateStatus = VALID |
| Statut agrege PARTIAL | 3 OK + 1 INDETERMINATE | aggregateStatus = PARTIAL |
| Statut agrege INVALID | 3 OK + 1 KO | aggregateStatus = INVALID |
| Schema canonique | Proof finalisee | Tous les champs PROOF-18 presents |
| Trust policy OCSP expire | OCSP + CRL expirees | Verification certificat = INDETERMINATE |
7.4 Historique des revisions¶
| Version | Date | Description |
|---|---|---|
| 1.0.0 | 2026-02-26 | Version initiale, generee depuis modeles formels |
| 1.1.0 | 2026-03-01 | Corrections review : (1) deux niveaux offline strict/source publique, (2) PENDING explicite dans artefact, (3) PROOF-14 scellement enveloppe, (4) RFC 9162 remplacee par RFC 5280, (5) materiel validation eIDAS OCSP/CRL, (6) matrice tracabilite PROOF-09 corrigee |
| 1.2.0 | 2026-03-02 | Verrouillage interop : (1) PROOF-15 resolution PENDING obligatoire avant finalisation — resolution du conflit PENDING/immutabilite/seal, (2) nommage envelopeSeal unifie, (3) PROOF-16 statut agrege VALID/PARTIAL/INVALID, (4) PROOF-17 politique de confiance offline (trust anchors, OCSP/CRL, temporalite), (5) PROOF-18 schema canonique JSON complet, (6) niveaux de preuve formelle (universel/borne/structurel/code), (7) correction mapping PROOF-09 -> Z INV-12 |