<user> is a user ID that people can use to locate your public key. A common user ID is your name and email address in the format: "Alice Cameron <email@example.com>". If your user ID contains spaces, you must enclose it in quotation marks.
<type> means you are creating either an RSA or a DH key.<bits> is the number of bits of the key (usually 1024 - 4096).
<passphrase> is a passphrase of your choice. If your passphrase includes spaces, enclose it in quotation marks.
NOTE: You can locate your keyrings using the --version -v command.
3. Exporting Your Public Key to a Text File
The command --export exports only public keys, while the command --export-key-pair exports private keys.
pgp --export/--export-key-pair <input> [options] where: – <input> is the user ID, portion of the user ID, or the key ID of the key you want to export.
[options] change the behavior of the command. Options are: --output lets you specify a different name for the exported file.
If you don’t enter any input, all keys on the keyring are exported.
By default, keys are exported as ASCII armor (.asc) files into the directory currently active on the command line.
Example: pgp --export example
All keys with the string “example” anywhere in them would be exported into separate .asc files.
pgp --export “Alice C <firstname.lastname@example.org>” Only keys that exactly match this user ID would be exported. The filename would be Alice C.asc.
There are three main options to perform signing in PGP commandline --sign, --clearsign, and --detached. These options are very different from one another and they each have their own use cases.
--sign is used to sign all file types including binary-based files. When using the --sign option remember to include the .pgp file extension so the file can be decrypted as all signed files are encasulated in the signed file.
Using the decrypt option would be used to verify the signed file. the --decrypt option can be used without putting in a passphrase.
--clearsign is only used for regular text documents such as notepad or ASCII format. The --clearsign option cannot be used with non-text file format. For example signing an Excel spreadsheet would result in a courrupted file that can no longer be used.