0

I have two keys in my keyring:

jason@host $ gpg --list-keys
/home/jason/.gnupg/pubring.gpg
------------------------------
pub   1024R/B051EDBF 2017-11-27
uid                  realname <[email protected]>
sub   1024R/4C83269B 2017-11-27

pub   1024R/28FDD919 2017-11-27
uid                  anothername <[email protected]>
sub   1024R/4C928D6B 2017-11-27

I can sign a file with it

jason@host $ gpg --sign example

And I can verify that signature

other@host $ gpg --verify ~jason/example.gpg

As the user "jason" how do I sign that file instead with the second key in the keyring?

(Note that I am using 1024 bit keys because they generate more quickly. This is POC work and will not be exposed to the internet.)

0

1 Answer 1

3

You specify a different default secret key. See section 1.2.1 of the GnuPG documentation.

gpg --default-key 28FDD919 --sign example

You can also change the default key in the GPG configuration file to make it persistent.

default-key 28FDD919

As a side-note, RSA 1024 is obsolete now days and is weak. 2048 is the recommended minimum.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .