Error message
invalid signature when validating ASN.1 encoded signature
Also printed as
- Error: failed to verify signature: could not verify message: invalid signature when validating ASN.1 encoded signature
- invalid signature when validating IEEE_P1363 encoded signature
Printed as "Error: …" and again as "error during command execution: …". With a bundle (`--bundle`) cosign 3 prefixes "failed to verify signature: could not verify message:". Signatures in IEEE P1363 form fail with "…when validating IEEE_P1363 encoded signature". The core text is the same in cosign 2.6 and 3.1.
Sigstore cosign (verify-blob / verify with --key) — sigstore-go signature verifier
What it means
cosign verified the ECDSA signature (DER/ASN.1 encoded, hence the wording) over the artifact's digest with the public key you supplied, and it did not match. Either the key is not the one that signed, or the artifact differs from what was signed. Unlike keyless verification, nothing about identities or the transparency log is involved — this is the raw signature check failing.
Why it happens
Verifying with the wrong public key
commonA key from another project, environment or release line; or a key that was rotated while old signatures are still being verified.
The artifact is not the signed one
commonA rebuilt binary, a re-compressed archive, a file downloaded through a proxy that changed it, or text with converted line endings.
Signature file of another artifact
occasional`.sig` files of several platforms (`linux-amd64`, `darwin-arm64`…) mixed up during download or in a release script.
How to fix it
- 1.
Compare the digest and the key
Check the artifact's SHA-256 against the published digest and the public key against the one derived from the signing key.
bash sha256sum artifact.txt # compare with the digest published with the release cosign public-key --key release.key > derived.pub # (key holder) public half of the signing key diff <(openssl pkey -pubin -in derived.pub -outform DER | sha256sum) \ <(openssl pkey -pubin -in cosign.pub -outform DER | sha256sum) - 2.
Ship bundles instead of loose signatures
A Sigstore bundle keeps signature and verification material together, which avoids most mix-ups.
bash # Prefer bundles: signature, verification material and the log entry travel together cosign sign-blob --yes --key release.key --bundle artifact.sigstore.json artifact.txt # uploads to Rekor cosign verify-blob --key release.pub --bundle artifact.sigstore.json artifact.txt
Related errors
--certificate-identity or --certificate-identity-regexp is required for verific…Sigstore cosign 2.x/3.x1 package has an invalid registry signature:npm audit signatures (npm 9.5+)gpg: BAD signature from "Release Bot <release@example.com>" [ultimate]GnuPG (gpg --verify, git verify-commit / verify-tag)