Skip to main content

verify_release

Function verify_release 

Source
pub fn verify_release(
    keys: &[UpdateKey],
    tag: &str,
    envelope: &[u8],
    signatures: &str,
    manifest: &[u8],
) -> Result<Manifest, VerifyError>
Expand description

Check a release’s envelope, its signatures file and its manifest against the trusted keys for the release called tag, and return the manifest only if every step passes (spec §5.2):

  1. a signature of the envelope by a trusted key;
  2. the envelope’s format, and its tag is tag (so an old signed envelope can’t be replayed under a newer tag);
  3. the manifest’s SHA-256 is the envelope’s manifest_sha256;
  4. the manifest’s format, tag and version agree with the envelope, and each file in it has a plain name, a SHA-256 and a size; each image, if it lists any, has a plain name, a repository and a sha256: digest, and no name twice.