gpg2 command examples
gpg2 – OpenPGP encryption and signing tool
#gpg -se -r Bob file
sign and encrypt for user Bob
#gpg --clearsign file
make a clear text signature
#gpg -sb file
make a detached signature
#gpg -u 0x12345678 -sb file
make a detached signature with the key 0x12345678
#gpg --list-keys user_ID
show keys
#gpg --fingerprint user_ID
show fingerprint
#gpg --verify pgpfile
#gpg --verify sigfile
Verify the signature of the file but do not output the data. The second form is used for detached signatures, where sigfile is the detached signature (either ASCII armored or binary) and are the signed data; if this is not given, the name of the file holding the signed data is constructed by cutting off the extension (“.asc” or “.sig”) of sigfile or by asking the user for the filename.