To enforce gpg --verify to only consider the specific public key 9F85796A16D64CC33CF084CA1E70BBC37279E5AB and reject all others, you can use the --keyring option to specify a custom keyring containing only that key. Here's how:
Extract the key 9F85796A16D64CC33CF084CA1E70BBC37279E5AB into a temporary keyring file:
bashgpg --no-default-keyring --keyring ./temp-keyring.gpg --export 9F85796A16D64CC33CF084CA1E70BBC37279E5AB
This creates a file temp-keyring.gpg containing only the specified key.
Use the temporary keyring to verify the signature. This ensures only the specified key is considered:
bashcat signature | gpg --no-default-keyring --keyring ./temp-keyring.gpg --verify
--no-default-keyring: Ignores the default keyring.--keyring ./temp-keyring.gpg: Uses only the temporary keyring.After verification, you can delete the temporary keyring:
bashrm ./temp-keyring.gpg
gpg cannot use any other keys for verification.This key is not certified with a trusted signature! will still appear (unless you explicitly trust the key), but the verification will only succeed if the signature matches the specified key.--trusted-keyIf you want to trust the key for this session (and suppress the warning), you can use:
bashcat signature | gpg --trusted-key 9F85796A16D64CC33CF084CA1E70BBC37279E5AB --verify
However, this does not enforce exclusivity—it only suppresses the warning. The first method (custom keyring) is stricter.
Vibe can make mistakes. Check answers. Learn more