Evaluate one binding: signature validity, signer trust, and content validity stay separate fields; provenance trust requires all three. `content_verified` must come from [`super::verify_binding_content`] (and, in CB-6C, from complete tree recomputation) — never from the signature.
(
binding: &GitStateBinding,
policy: &GitTrustConfig,
input: BindingVerificationInput<'_>,
content_verified: bool,
)
| 64 | /// `content_verified` must come from [`super::verify_binding_content`] (and, |
| 65 | /// in CB-6C, from complete tree recomputation) — never from the signature. |
| 66 | pub fn evaluate_binding_trust( |
| 67 | binding: &GitStateBinding, |
| 68 | policy: &GitTrustConfig, |
| 69 | input: BindingVerificationInput<'_>, |
| 70 | content_verified: bool, |
| 71 | ) -> BindingTrustEvaluation { |
| 72 | let signature_valid = binding.verify_signature().is_ok(); |
| 73 | let signer_trust = if signature_valid { |
| 74 | policy.evaluate(&binding.payload().signer.did, input.repository_identity) |
| 75 | } else { |
| 76 | // An unverifiable signature is never trusted, whatever the policy. |
| 77 | SignerTrust::Unknown |
| 78 | }; |
| 79 | BindingTrustEvaluation { |
| 80 | signature_valid, |
| 81 | signer_trust, |
| 82 | content_verified, |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | /// Convenience: signer trust for a DID under the policy, with the repository |
| 87 | /// identity as the default trust root. |