Using a specific PGP key pair for digital signing

Monday, August 12, 2024 at 6:30 PM | 1 min read

Last modified on Friday, August 16, 2024 at 12:00 AM

#asymmetric encryption, #complete signature, #gpg, #linux, #pgp, #pgp key pair, #security, #series

Key in lock, key pair hanging from chain

Photo by PhotoMIX Company on pexels.com

Table of Contents

Digital signing a file using a specific key

Since I want to digitally "sign" a file using a specific key, I will run the following command using the PGP key pair called "Maria" which I have been using for digital signing and local testing:

gpg --local-user "Maria" -s inline_signature.txt

And this creates a file called inline_signature.txt.gpg, indicating it is an inline or complete signature.

The --local-user option specifies a user id (or name) to use for signing. In my case, it is "Maria". And that is how I set up the PGP key pair in the article entitled Making and verifying digital signatures using GPG in Linux.

That is what is meant by "Digital signing a file using a specific key".

Asymmetric encryption and decryption series