Verify a signed RPM against a KeySigner approval

Check that a signed RPM came from the expected publisher and matches the exact package your release owners approved in KeySigner.

Before you start

KeySigner release approvals, rpmkeys and GnuPG

  • Use two enrolled owners, a disposable signed RPM outside production repositories, and the publisher certificate with an independently verified fingerprint. Use an RPM build that supports the _pkgverify_level verification policy.

Data and access

Shared or checked
RPM verifies the package with the trusted publisher certificate. KeySigner records the release owners’ approval and compares the approved digest with a digest reported by the requester or administrator.
Check separately
Publishing permissions and the publisher’s signing key stay with the package publisher. Check the signature and approval for the same file.
  1. Approve the exact signed RPM

    Have the publisher sign the test RPM before you compute its SHA-256. Register the test package under registry rpm and set the rule to require both owners. In your KeySigner test release workflow, submit the digest with the sha256: prefix, along with the package, full version and release, and source run. Save the approved request ID and digest.

    sha256sum package-1.0.0-1.noarch.rpm

    Check. The request waits after the first eligible approval and becomes approved once both owners approve the original signed file.

  2. Check the publisher’s key

    Compare the full fingerprint with the expected fingerprint from your release policy. Use a file that contains only the verified publisher certificate. Create a temporary RPM database and import that certificate into it.

    gpg --show-keys --with-fingerprint publisher.asc
    keys="$(mktemp -d)"
    rpmkeys --dbpath "$keys" --import publisher.asc

    Check. The certificate has the expected fingerprint, and the temporary RPM database contains only that trusted publisher certificate.

  3. Verify the copy you received

    Download the RPM from the test location. Use the temporary RPM database to require a signature and check the package digests. Stop if verification fails or the expected signature is missing.

    rpmkeys --dbpath "$keys" --define '_pkgverify_level all' \
      --checksig --verbose package-1.0.0-1.noarch.rpm

    Check. rpmkeys exits successfully and reports a valid signature and digests for that file.

  4. Compare it with the release approval

    In the KeySigner console, open Accounts and find the approved request in the package history. Hash the same file that passed verification. Compare all 64 hexadecimal characters with the KeySigner digest after the sha256: prefix. After publication, the requester or an administrator can record the digest of the served RPM with POST /v1/operations/{operation_id}/published-bytes.

    sha256sum package-1.0.0-1.noarch.rpm

    Check. The file digest exactly matches the approved digest. If submitted, KeySigner records a match.

  5. Try a signed replacement

    Change a file inside the test package, rebuild with the same name, version and release, and have the same test publisher sign it again. Repeat the signature check and compare the digest with the original approval. If you record the replacement digest against the original request, review the resulting finding in KeySigner.

    Check. The replacement’s publisher signature can pass. Its changed digest differs from the approval, and recording that digest creates a finding.

Check your result

Release the RPM after the expected publisher signature and the approved digest both pass for the same file. Keep the request ID, source run, verified fingerprint and digest with the release record.

What we tested

Tested on . RPM 6.1.0 verified two local builds signed by the same test publisher. It rejected the unsigned build, altered bytes and verification without the publisher key. In a local KeySigner test, two owners approved the original RPM. KeySigner recorded a match for it and a mismatch and finding for the signed replacement.

How to verify your setup

If you get stuck

The publisher signature passes and the digest differs

Pause the release and compare the signed build output and the file you downloaded. Rebuilding or re-signing a package can change its bytes. If the replacement is intended, request a new approval for its exact digest.

Report a problem with this guide

Explore all setup guides →