Gpg Generate Key Non Interactive
Gpg Generate Key Non Interactive 3,5/5 8297 reviews

GNU gpg is encryption and signing tool.

  1. Gpg Generate Key Non Interactive Number
  2. Gpg Generate Key Non Interactive Number
  3. Generate Gpg Key Windows
  4. Gpg Generate Key Non Interactive Software

The GNU Privacy Guard (GnuPG or GPG) is a free software replacement for the PGP suite of cryptographic software.

Jun 30, 2018 Create Your Public/Private Key Pair and Revocation Certificate. Use gpg -full-gen-key command to generate your key pair. Gpg -full-gen-key. It asks you what kind of key you want. Notice there’re four options. The default is to create a RSA public/private key pair and also a RSA signing key. Let’s hit Enter to select the default. I am going to add a feature in my own version of SSPKS to sign Synology packages. But to do this, I need a way to create GPG key from a non-interactive script. Click to Read More.

GnuPG encrypts messages using asymmetric keypairs individually generated by GnuPG users. The resulting public keys can be exchanged with other users in a variety of ways, such as Internet key servers. They must always be exchanged carefully to prevent identity spoofing by corrupting public key ↔ ‘owner’ identity correspondences. It is also possible to add a cryptographic digital signature to a message, so the message integrity and sender can be verified, if a particular correspondence relied upon has not been corrupted.

How do I create my own GnuPG private and public key

1) Login to your shell account

2) Use gpg command to create the keys
$ gpg --gen-key
Output:

3) Now keys generated, you can list your own key using:
$ gpg -K
OR
$ gpg --list-keys
Output:

Let us try to understand the line pub 1024D/CA7A8402 2007-02-10:

  • pub : Public key
  • 1024D : The number of bits in the key
  • CA7A8402 : The key ID
  • 2007-02-10 : The date of key creation
  • Vivek Gite : The user real name
  • <[email protected]> : The email id

Most important is the key ID i.e. CA7A8402. Make sure you use powerful passphrase to protect keys and not the easy one.

4) To list secret key, type the command:
$ gpg --list-secret-keys
Output:

ADVERTISEMENTS

Old Man Page

This is a very old version of the gpg man page. Please see the latestrelease or software package for your operating system to find an up todate version ('man gpg2').

gpg

Name

Synopsis

DESCRIPTION

gpg is the main program for the GnuPG system.

This man page does only list the commands and options available. For amore verbose documentation get the GNU Privacy Handbook (GPH), which isavailable at https://www.gnupg.org/gph/ . You will find a list of HOWTOdocuments at https://www.gnupg.org/docs.html .

COMMANDS

gpg recognizes these commands:

-s, --sign

Make a signature. This command may be combined with--encrypt.

--clearsign

Make a clear text signature.

-b, --detach-sign

Make a detached signature.

-e, --encrypt

Encrypt data. This option may be combined with--sign.

-c, --symmetric

Encrypt with symmetric cipher only This commandasks for a passphrase.

--store

Store only (make a simple RFC1991 packet).

--decrypt [ file ]

Decrypt file (or stdin if no file isspecified) and write it to stdout (or the file specified with--output). If the decrypted file is signed, the signature is alsoverified. This command differs from the default operation, as itnever writes to the filename which is included in the file and itrejects files which don't begin with an encrypted message.

--verify [[ sigfile ] [ signed-files ]]

Assume that sigfile is asignature and verify it without generating any output. With noarguments, the signature packet is read from stdin (it may be adetached signature when not used in batch mode). If only a sigfile isgiven, it may be a complete signature or a detached signature, inwhich case the signed stuff is expected in a file without the '.sig'or '.asc' extension (if such a file does not exist it is expected atstdin; use a single dash ('-') as filename to force a read fromstdin). With more than 1 argument, the first should be a detachedsignature and the remaining files are the signed stuff.

--verify-files [ files ]

This is a special version of the --verifycommand which does not work with detached signatures. The commandexpects the files to bee verified either on the commandline or readsthe filenames from stdin; each anem muts be on separate line. Thecommand is intended for quick checking of many files.

--list-keys [ names ], --list-public-keys [ names ]

List all keysfrom the public keyrings, or just the ones given on the command line.

--list-secret-keys [ names ]

List all keys from the secretkeyrings, or just the ones given on the command line.

--list-sigs [ names ]

Same as --list-keys, but the signatures arelisted too.

--check-sigs [ names ]

Same as --list-sigs, but the signatures areverified.

--fingerprint [ names ]

List all keys with their fingerprints.This is the same output as --list-keys but with the additional outputof a line with the fingerprint. May also be combined with --list-sigsor --check-sigs. If this command is given twice, the fingerprints ofall secondary keys are listed too.

--list-packets

List only the sequence of packets. This is mainlyuseful for debugging.

--gen-key

Generate a new key pair. This command is normally onlyused interactive.

There is an experimental feature which allows to create keys in batchmode. See the file doc/DETAILS in the source distribution on how touse this.

--edit-key name

Present a menu which enables you to do all keyrelated tasks:

Gpg Generate Key Non Interactive Number

sign
Make a signature on key of user name If the key is notyet signed by the default user (or the users given with -u), theprogram displays the information of the key again, together withits fingerprint and asks whether it should be signed. Thisquestion is repeated for all users specified with -u.
lsign
Same as --sign but the signature is marked asnon-exportable and will therefore never be used by others. Thismay be used to make keys valid only in the local environment.
revsig
Revoke a signature. GnuPG asks for every signature whichhas been done by one of the secret keys, whether a revocationcertificate should be generated.
trust
Change the owner trust value. This updates the trust-dbimmediately and no save is required.
disable, enable
Disable or enable an entire key. A disabled keycan normally not be used for encryption.
adduid
Create an alternate user id.
deluid
Delete an user id.
addkey
Add a subkey to this key.
delkey
Remove a subkey.
revkey
Revoke a subkey.
expire
Change the key expiration time. If a key is selected,the time of this key will be changed. With no selection the keyexpiration of the primary key is changed.
passwd
Change the passphrase of the secret key.
uid n
Toggle selection of user id with index n. Use 0 todeselect all.
key n
Toggle selection of subkey with index n. Use 0 todeselect all.
check
Check all selected user ids.
pref
List preferences.
toggle
Toggle between public and secret key listing.
save
Save all changes to the key rings and quit.
quit
Quit the program without updating the key rings.

The listing shows you the key with its secondary keys and all userids. Selected keys or user ids are indicated by an asterisk. Thetrust value is displayed with the primary key: the first is theassigned owner trust and the second is the calculated trust value.Letters are used for the values:

-
No ownertrust assigned / not yet calculated.
e
Trust calculation has failed.
q
Not enough information for calculation.
n
Never trust this key.
m
Marginally trusted.
f
Fully trusted.
u
Ultimately trusted.
--sign-key name

Sign a public key with you secret key. This is ashortcut version of the subcommand 'sign' from --edit.

--lsign-key name

Gpg Generate Key Non Interactive Number

Sign a public key with you secret key but markit as non-exportable. This is a shortcut version of the subcommand'lsign' from --edit.

--trusted-key long key ID

Assume that the specified key (whichmust be given as a full 8 byte key ID) is as trustworthy as one ofyour own secret keys. This option is useful if you don't want to keepyour secret keys (or one of them) online but still be able to checkthe validity of a given recipient's or signator's key.

--delete-key name

Remove key from the public keyring

--delete-secret-key name
Gpg

Remove key from the secret and publickeyring

--gen-revoke

Generate a revocation certificate for the completekey. To revoke a subkey or a signature, use the --edit command.

--export [ names ]

Either export all keys from all keyrings(default keyrings and those registered via option --keyring), or ifat least one name is given, those of the given name. The new keyringis written to stdout or to the file given with option 'output'. Usetogether with --armor to mail those keys.

--send-keys [ names ]

Same as --export but sends the keys to akeyserver. Option --keyserver must be used to give the name of thiskeyserver. Don't send your complete keyring to a keyserver - selectonly those keys which are new or changed by you.

--export-all [ names ]

Same as --export, but does also export keyswhich are not compatible to OpenPGP.

(no term)

--export-secret-keys [ names ], --export-secret-subkeys[ names ] :: Same as --export, but does export the secret keys. Thisis normally not very useful and a security risk. the second form ofthe command has the special property to render the secret part of theprimary key useless; this is a GNU extension to OpenPGP and otherimplementations can not be expected to successful import such a key.

--import [ files ], --fast-import [ files ]

Import/merge keys.This adds the given keys to the keyring. The fast version does notbuild the trustdb; this can be done at any time with the command--update-trustdb.

There are a few other options which control how this command works.Most notable here is the --merge-only options which does not insertnew keys but does only the merging of new signatures, user-IDs andsubkeys.

--recv-keys key IDs

Import the keys with the given key IDs froma HKP keyserver. Option --keyserver must be used to give the name ofthis keyserver.

--export-ownertrust

List the assigned ownertrust values in ASCIIformat for backup purposes

--import-ownertrust [ files ]

Update the trustdb with theownertrust values stored in files (or stdin if not given); existingvalues will be overwritten.

--print-md algo [ files ]

Print message digest of algorithm ALGOfor all given files of stdin. If '*' is used for the algorithm,digests for all available algorithms are printed.

--gen-random 0 1 2 [ count ]

Emit COUNT random bytes of thegiven quality level. If count is not given or zero, an endlesssequence of random bytes will be emitted. PLEASE, don't use thiscommand unless you know what you are doing, it may remove preciousentropy from the system!

--gen-prime modebits [ qbits ]

Use the source, Luke :-). Theoutput format is still subject to change.

--version

Print version information along with a list of supportedalgorithms.

--warranty

Print warranty information.

-h, --help

Print usage information. This is a really long listeven it does list not all options.

OPTIONS

Long options can be put in an options file (default '~/.gnupg/options').Do not write the 2 dashes, but simply the name of the option and anyrequired arguments. Lines with a hash as the first non-white-spacecharacter are ignored. Commands may be put in this file too, but thatdoes not make sense.

gpg recognizes these options:

-a, --armor

Create ASCII armored output.

-o, --output file

Write output to file.

-u, --local-user name

Use name as the user ID to sign. Thisoption is silently ignored for the list commands, so that it can beused in an options file.

--default-key name

Use name as default user ID for signatures.If this is not used the default user ID is the first user ID found inthe secret keyring.

-r, --recipient name,

Encrypt for user id name. If thisoption is not specified, GnuPG asks for the user-id unless--default-recipient is given

--default-recipient name

Use name as default recipient ifoption --recipient is not used and don't ask if this is a valid one.name must be a non empty.

--default-recipient-self

Use the default key as default recipientif option --recipient is not used and don't ask if this is a validone. The default key is the first one from the secret keyring or theone set with --default-key.

--no-default-recipient

Reset --default-recipient and--default-recipient-self.

--encrypt-to name

Same as --recipient but this one is intendedfor in the options file and may be used together with an own user-idas an 'encrypt-to-self'. These keys are only used when there areother recipients given either by use of --recipient or by the askeduser id. No trust checking is performed for these user ids and evendisabled keys can be used.

--no-encrypt-to

Disable the use of all --encrypt-to keys.

-v, --verbose

Give more information during processing. If usedtwice, the input data is listed in detail.

-q, --quiet

Try to be as quiet as possible.

-z n

Set compression level to n. A value of 0 for n disablescompression. Default is to use the default compression level of zlib(normally 6).

-t, --textmode

Use canonical text mode. If -t (but not --textmode)is used together with armoring and signing, this enables clearsignedmessages. This kludge is needed for PGP compatibility; normally youwould use --sign or --clearsign to selected the type of thesignature.

-n, --dry-run

Don't make any changes (this is not completelyimplemented).

-i, --interactive

Prompt before overwriting any files.

--batch

Use batch mode. Free software key generator. Never ask, do not allow interactivecommands.

--no-tty

Make sure that the TTY (terminal) is never used for anyoutput. This option is needed in some cases because GnuPG sometimesprints warnings to the TTY if if --batch is used.

--no-batch

Disable batch mode. This may be of use if --batch isenabled from an options file.

--yes

Assume 'yes' on most questions.

--no

Assume 'no' on most questions.

--always-trust

Skip key validation and assume that used keys arealways fully trusted. You won't use this unless you have installedsome external validation scheme.

--keyserver name

Use name to lookup keys which are not yet inyour keyring. This is only done while verifying messages withsignatures. The option is also required for the command --send-keysto specify the keyserver to where the keys should be send. Allkeyservers synchronize with each other - so there is no need to sendkeys to more than one server. Using the command 'host -l pgp.net grep wwwkeys' gives you a list of keyservers. Because there is loadbalancing using round-robin DNS you may notice that you get differentkey servers.

--no-auto-key-retrieve

This option disables the automaticretrieving of keys from a keyserver while verifying signatures. Thisoption allows to keep a keyserver in the options file or the--send-keys and --recv-keys commands.

--honor-http-proxy

Try to access the keyserver over the proxy setwith the variable 'httpproxy'.

--keyring file

Add file to the list of keyrings. If filebegins with a tilde and a slash, these are replaced by the HOMEdirectory. If the filename does not contain a slash, it is assumed tobe in the home-directory ('~/.gnupg' if --homedir is not used). Thefilename may be prefixed with a scheme:

'gnupg-ring:' is the default one.

'gnupg-gdbm:' may be used for a GDBM ring. Note that GDBM isexperimental and likely to be removed in future versions.

It might make sense to use it together with --no-default-keyring.

--secret-keyring file

Same as --keyring but for the secretkeyrings.

--homedir directory

Set the name of the home directory todirectory If this option is not used it defaults to '~/.gnupg'. Itdoes not make sense to use this in a options file. This alsooverrides the environment variable 'GNUPGHOME'.

--charset name

Set the name of the native character set. This isused to convert some strings to proper UTF-8 encoding. Valid valuesfor name are:

iso-8859-1
This is the default Latin 1 set.
iso-8859-2
The Latin 2 set.
koi8-r
The usual Russian set (rfc1489).
--utf8-strings, --no-utf8-strings

Assume that the arguments arealready given as UTF8 strings. The default (--no-utf8-strings) is toassume that arguments are encoded in the character set as specifiedby --charset. These options effects all following arguments. Bothoptions may used multiple times.

--options file

Php defuse crypto generate encryption key. Read options from file and do not try to readthem from the default options file in the homedir (see --homedir).This option is ignored if used in an options file.

--no-options

Shortcut for '--options /dev/null'. This option isdetected before an attempt to open an option file.

--load-extension name

Load an extension module. If name doesnot contain a slash it is searched in '/usr/local/lib/gnupg' See themanual for more information about extensions.

--debug flags

Set debugging flags. All flags are or-ed andflags may be given in C syntax (e.g. 0x0042).

--debug-all

Set all useful debugging flags.

--status-fd n

Write special status strings to the filedescriptor n. See the file DETAILS in the documentation for alisting of them.

--logger-fd n

Write log output to file descriptor n and not tostderr.

--no-comment

Do not write comment packets. This option affectsonly the generation of secret keys. Please note, that this hasnothing to do with the comments in clear text signatures.

--comment string

Use string as comment string in clear textsignatures. To suppress those comment strings entirely, use an emptystring here.

--default-comment

Force to write the standard comment string inclear text signatures. Use this to overwrite a --comment from aconfig file.

--no-version

Omit the version string in clear text signatures.

--emit-version

Force to write the version string in clear textsignatures. Use this to overwrite a previous --no-version from aconfig file.

-N, --notation-data name=value

Put the name value pair into thesignature as notation data. name must consists only of alphanumericcharacters, digits or the underscore; the first character must not bea digit. value may be any printable string; it will encoded inUTF8, so sou should have check that your --charset is set right. Ifyou prefix name with an exclamation mark, the notation data will beflagged as critical (rfc2440:5.2.3.15).

--set-policy-url string

Use string as Policy URL forsignatures (rfc2440:5.2.3.19). If you prefix it with an exclamationmark, the policy URL packet will be flagged as critical.

--set-filename string

Use string as the name of file which isstored in messages.

--use-embedded-filename

Try to create a file with a name asembedded in the data. This can be a dangerous option as it allows tooverwrite files.

--completes-needed n

Number of completely trusted users tointroduce a new key signer (defaults to 1).

--marginals-needed n

Number of marginally trusted users tointroduce a new key signer (defaults to 3)

--max-cert-depth n

Maximum depth of a certification chain(default is 5).

--cipher-algo name

Use name as cipher algorithm. Running theprogram with the command --version yields a list of supportedalgorithms. If this is not used the cipher algorithm is selected fromthe preferences stored with the key.

--digest-algo name

Use name as message digest algorithm.Running the program with the command --version yields a list ofsupported algorithms. Please note that using this option may violatethe OpenPGP requirement, that a 160 bit hash is to be used for DSA.

--s2k-cipher-algo name

Use name as the cipher algorithm usedto protect secret keys. The default cipher is BLOWFISH. This cipheris also used for conventional encryption if --cipher-algo is notgiven.

--s2k-digest-algo name

Use name as the digest algorithm usedto mangle the passphrases. The default algorithm is RIPE-MD-160. Thisdigest algorithm is also used for conventional encryption if--digest-algo is not given.

--s2k-mode n

Selects how passphrases are mangled. If n is 0 aplain passphrase (which is not recommended) will be used, a 1(default) adds a salt to the passphrase and a 3 iterates the wholeprocess a couple of times. Unless --rfc1991 is used, this mode isalso used for conventional encryption.

Generate Gpg Key Windows

--compress-algo n

Use compress algorithm n. Default is 2 whichis RFC1950 compression. You may use 1 to use the old zlib version(RFC1951) which is used by PGP. The default algorithm may give betterresults because the window size is not limited to 8K. If this is notused the OpenPGP behavior is used, i.e. the compression algorithm isselected from the preferences; note, that this can't be done if youdo not encrypt the data.

--disable-cipher-algo name

Never allow the use of name ascipher algorithm. The given name will not be checked so that a laterloaded algorithm will still get disabled.

--disable-pubkey-algo name

Never allow the use of name aspublic key algorithm. The given name will not be checked so that alater loaded algorithm will still get disabled.

--throw-keyid

Do not put the keyid into encrypted packets. Thisoption hides the receiver of the message and is a countermeasureagainst traffic analysis. It may slow down the decryption processbecause all available secret keys are tried.

--not-dash-escaped

This option changes the behavior of cleartextsignatures so that they can be used for patch files. You should notsend such an armored file via email because all spaces and lineendings are hashed too. You can not use this option for data whichhas 5 dashes at the beginning of a line, patch files don't have this.A special armor header line tells GnuPG about this cleartextsignature option.

--escape-from-lines

Because some mailers change lines startingwith 'From ' to '<From ' it is good to handle such lines in a specialway when creating cleartext signatures. All other PGP versions do itthis way too. This option is not enabled by default because it wouldviolate rfc2440.

--passphrase-fd n

Read the passphrase from file descriptor n.If you use 0 for n, the passphrase will be read from stdin. Thiscan only be used if only one passphrase is supplied. Don't use thisoption if you can avoid it.

--command-fd n

This is a replacement for the depreciatedshared-memory IPC mode. If this option is enabled, user input onquestions is not expected from the TTY but from the given filedescriptor. It should be used together with --status-fd. See the filedoc/DETAILS in the source distribution for details on how to use it.

--rfc1991

Try to be more RFC1991 (PGP 2.x) compliant.

--openpgp

Reset all packet, cipher and digest options to OpenPGPbehavior. Use this option to reset all previous options like--rfc1991, --force-v3-sigs, --s2k-*, --cipher-algo, --digest-algo and--compress-algo to OpenPGP compliant values. All PGP workarounds arealso disabled.

--force-v3-sigs

OpenPGP states that an implementation shouldgenerate v4 signatures but PGP 5.x recognizes v4 signatures only onkey material. This options forces v3 signatures for signatures ondata.

--force-mdc

Force the use of encryption with appended manipulationcode. This is always used with the newer cipher (those with ablocksize greater than 64 bit). This option might not be implementedyet.

--allow-non-selfsigned-uid

Allow the import of keys with user IDswhich are not self-signed. This is only allows the import - keyvalidation will fail and you have to check the validity of the key myother means. This hack is needed for some German keys generated withpgp 2.6.3in. You should really avoid using it, because OpenPGP hasbetter mechanics to do separate signing and encryption keys.

--allow-freeform-uid

Disable all checks on the form of the user IDwhile generating a new one. This option should only be used in veryspecial environments as it does not ensure the de-facto standardformat of user IDs.

--ignore-time-conflict

GnuPG normally checks that the timestampsassociated with keys and signatures have plausible values. However,sometimes a signature seems to be older than the key due to clockproblems. This option makes these checks just a warning.

--lock-once

Lock the databases the first time a lock is requestedand do not release the lock until the process terminates.

--lock-multiple

Release the locks every time a lock is no longerneeded. Use this to override a previous --lock-once from a configfile.

--lock-never

Disable locking entirely. This option should be usedonly in very special environments, where it can be assured that onlyone process is accessing those files. A bootable floppy with astandalone encryption system will probably use this. Improper usageof this option may lead to data and key corruption.

--no-random-seed-file

GnuPG uses a file to store it's internalrandom pool over invocations. This makes random generation faster;however sometimes write operations are not desired. This option canbe used to achive that with the cost of slower random generation.

--no-verbose

Reset verbose level to 0.

--no-greeting

Suppress the initial copyright message but do notenter batch mode.

--no-secmem-warning

Suppress the warning about 'using insecurememory'.

--no-armor

Assume the input data is not in ASCII armored format.

--no-default-keyring

Do not add the default keyrings to the listof keyrings.

--skip-verify

Skip the signature verification step. This may beused to make the decryption faster if the signature verification isnot needed.

--with-colons

Print key listings delimited by colons.

--with-key-data

Print key listings delimited by colons and printthe public key data.

--with-fingerprint

Same as the command --fingerprint but changesonly the format of the output and may be used together with anothercommand.

--fast-list-mode

Changes the output of the list commands to workfaster; this is achieved by leaving some parts empty. Someapplications don't need the user ID and the trust information givenin the listings. By using this options they can get a faster listing.The excact behaviour of this option may change in future versions.

--list-only

Changes the behaviour of some commands. This is like--dry-run but different in some cases. The semantic of this commandmay be extended in the future. Currently it does only skip the actualdecryption pass and therefore enables a fast listing of theencryption keys.

Gpg Generate Key Non Interactive Software

--no-literal

This is not for normal use. Use the source to see forwhat it might be useful.

--set-filesize

This is not for normal use. Use the source to seefor what it might be useful.

--emulate-md-encode-bug

GnuPG versions prior to 1.0.2 had a bug inthe way a signature was encode. This options enables a workaround bychecking faulty signatures again with the encoding used in oldversions. This may only happen for ElGamal signatures which are notwidely used.

--show-session-key

Display the session key used for one message.See --override-session-key for the counterpart of this option.

We think that Key-Escrow is a Bad Thing; however the user should havethe freedom to decide whether to go to prison or to reveal thecontent of one specific message without compromising all messagesever encrypted for one secret key. DON'T USE IT UNLESS YOU ARE REALLYFORCED TO DO SO.

--override-session-key string

Don't use the public key but thesession key string. The format of this string is the same as theone printed by --show-session-key. This option is normally not usedbut comes handy in case someone forces you to reveal the content ofan encrypted message; using this option you can do this withouthanding out the secret key.

--merge-only

Don't insert new keys into the keyrings while doingan import.

--try-all-secrets

Don't look at the key ID as stored in themessage but try all secret keys in turn to find the right decryptionkey. This option forces the behaviour as used by anonymous recipients(created by using --throw-keyid) and might come handy in case wherean encrypted message contains a bogus key ID.

How to specify a user ID

There are different ways on how to specify a user ID to GnuPG; here aresome examples:

  • :: Used to locate the default home directory.
  • Here the key ID isgiven in the usual short form.
  • 234AABBCC34567C4, 0F323456784E56EAB, 01AB3FED1347A5612,0x234AABBCC34567C4 :: Here the key ID is given in the long form asused by OpenPGP.
  • 1234343434343434C434343434343434,123434343434343C3434343434343734349A3434,0E12343434343434343434EAB3484343434343434,0xE12343434343434343434EAB3484343434343434 :: The best way to specifya key ID is by using the fingerprint of the key. This avoids anyambiguities in case that there are duplicated key IDs (which arereally rare for the long key IDs).
  • Using an exact tomatch string. The equal sign indicates this.
  • Using the email address part whichmust match exactly. The left angle bracket indicates this emailaddress mode.
  • All words must match exactly (not casesensitive) but can appear in any order in the user ID. Words are anysequences of letters, digits, the underscore and all characters withbit 7 set.
  • Using the Local ID. This is a very low level method and shouldonly be used by applications which really need it. The hash characterindicates this method. An application should not assume that this isonly a number.
  • By case insensitive substring matching. This is thedefault mode but applications may want to explicitely indicate thisby putting the asterisk in front.

RETURN VALUE

The program returns 0 if everything was fine, 1 if at least a signaturewas bad, and other error codes for fatal errors.

EXAMPLES

gpg -se -r Bobfile
sign and encrypt for user Bob
gpg --clearsign file
make a clear text signature
gpg -sb file
make a detached signature
gpg --list-keys user_ID
show keys
gpg --fingerprint user_ID
show fingerprint
gpg --verify pgpfile, gpg --verify sigfile [ files ]
Verifythe signature of the file but do not output the data. The second formis used for detached signatures, where sigfile is the detachedsignature (either ASCII armored of binary) and [ files ] are thesigned data; if this is not given the name of the file holding thesigned data is constructed by cutting off the extension ('.asc' or'.sig') of sigfile or by asking the user for the filename.

ENVIRONMENT

HOME
Used to locate the default home directory.
GNUPGHOME
If set directory used instead of '~/.gnupg'.
httpproxy
Only honored when the option --honor-http-proxy isset.

FILES

~/.gnupg/secring.gpg
The secret keyring
~/.gnupg/secring.gpg.lock
and the lock file
~/.gnupg/pubring.gpg
The public keyring
~/.gnupg/pubring.gpg.lock
and the lock file
~/.gnupg/trustdb.gpg
The trust database
~/.gnupg/trustdb.gpg.lock
and the lock file
~/.gnupg/randomseed
used to preserve the internal random pool
~/.gnupg/options
May contain options
/usr[/local]/share/gnupg/options.skel
Skeleton options file
usr[/local]/lib/gnupg
Default location for extensions

WARNINGS

Use a good password for your user account and a good passphrase toprotect your secret key. This passphrase is the weakest part of thewhole system. Programs to do dictionary attacks on your secret keyringare very easy to write and so you should protect your '~/.gnupg/'directory very well.

Keep in mind that, if this program is used over a network (telnet), itis very easy to spy out your passphrase!

BUGS

On many systems this program should be installed as setuid(root). Thisis necessary to lock memory pages. Locking memory pages prevents theoperating system from writing memory pages to disk. If you get nowarning message about insecure memory 3our operating system supportslocking without being root. The program drops root privileges as soon aslocked memory is allocated.