28

I have multiple secret keys in my GPG keyring.

I'd like to do a gpg -e -s -a to encrypt, sign, and ascii armor the output. However, I also need to specify which secret key to use for the signature, by key id.

Dustin Kirkland
  • 5,323
  • 3
  • 36
  • 34

1 Answers1

41

I needed the --local-user option.

gpg -e -s -a --local-user 0xDEADBEEF -r 0x01234567
Dustin Kirkland
  • 5,323
  • 3
  • 36
  • 34
  • 11
    Just for the record: `--local-user` or `-u` for short. – DrBeco Nov 11 '14 at 14:13
  • I didn't understand why you needed to use local user – RollRoll Aug 11 '16 at 00:39
  • 1
    If you have multiple keys and want to sign the fourth key with the third key, (when gpg defaults to the first key) then you need -u --local-user to specify the key that is doing the signing. – Alexx Roche Sep 21 '16 at 10:36
  • 4
    For those who probably do not know,‍`-e, --encrypt` , `-s, --sign` , `-a, --armor` , `-r, --recipient` , `-u , --local-user` – Freeman Feb 13 '21 at 09:41