// parseImageAndDockerReference converts an image and a reference string into two parsed entities, failing on any error and handling unidentified images.
// Do not add default tags: image.Reference().DockerReference() should contain it already, and signatureDockerReference should be exact; so, verify that now.
// Do not add default tags: image.Reference().DockerReference() should contain it already, and signatureDockerReference should be exact; so, verify that now.
ifreference.IsNameOnly(signature){
returnfalse
}
switchintended.(type){
casereference.NamedTagged:// Includes the case when intended has both a tag and a digest.
returnsignature.String()==intended.String()
casereference.Canonical:
// We don’t actually compare the manifest digest against the signature here; that happens prSignedBy.in UnparsedImage.Manifest.
// Becase UnparsedImage.Manifest verifies the intended.Digest() against the manifest, and prSignedBy verifies the signature digest against the manifest,
// we know that signature digest matches intended.Digest() (but intended.Digest() and signature digest may use different algorithms)