To sign data with your own key one uses the command:
By doing this also compression takes place. This means that the result is not legible. If you want a legible result you can use:gpg -s (or --sign) [Data]
this will make sure that the results are clearly legible. Furthermore it does the same (signing data).gpg --clearsign [Data]
With
you can write the signature in a seperate file. It is highly recommened to use this option especially when signing binary files (like archives for instance). Also thegpg -b (or --detach-sign) [Data]
--armor
option
can be extremely usefull here.
Quite often one finds that data is encrypted and signed as well. The full instruction looks like:
gpg [-u Sender] [-r Recipient] [--armor] --sign --encrypt [Data]
The functionality of the options -u
(--local-user
) and -r
(--recipient
) are as described before.
When encrypted data has been signed as well, the signature is checked when the data is decrypted. You can check the signature of signed data by using the command:
This will only work (of course) when you own the public key of the sender.gpg [--verify] [Data]