Skip to main content

verify_admin_bundle

Function verify_admin_bundle 

Source
pub fn verify_admin_bundle(
    opened: OpenedArmored,
    expect_digest: Option<&str>,
    expected_vta_did: Option<&str>,
) -> Result<CredentialBundle, Box<dyn Error>>
Expand description

Check that an opened bundle is anchored to the expected producer, then extract its admin credential.

HPKE sealing gives confidentiality, not authenticity: anyone who has seen the consumer’s bootstrap request can seal a bundle to it. A credential is only installed when something the operator trusts vouches for the bundle:

  • PinnedOnly: the out-of-band digest, expect_digest. The admin credentials that pnm, cnm and vta seal today all take this form, with a throwaway producer did:key.
  • DidSigned: a signature by expected_vta_did itself. A valid signature from any other DID proves nothing, since anyone can mint a did:key and sign, so the producer DID must equal expected_vta_did, with or without a digest. Only did:key producers can be verified here; other methods would need DID resolution.
  • Attested: refused. Attestation quotes are verified by pnm bootstrap connect, not on this path.

When expected_vta_did is given, the credential’s vta_did must also equal it, so a bundle cannot point the session at a different VTA from the one the operator named.