| | 1 | = Using the gpg command line tool = |
| | 2 | |
| | 3 | == Generating a key == |
| | 4 | |
| | 5 | {{{ |
| | 6 | 0 guest@animal:~$ gpg --gen-key |
| | 7 | gpg (GnuPG) 1.4.12; Copyright (C) 2012 Free Software Foundation, Inc. |
| | 8 | This is free software: you are free to change and redistribute it. |
| | 9 | There is NO WARRANTY, to the extent permitted by law. |
| | 10 | |
| | 11 | gpg: directory `/home/guest/.gnupg' created |
| | 12 | gpg: new configuration file `/home/guest/.gnupg/gpg.conf' created |
| | 13 | gpg: WARNING: options in `/home/guest/.gnupg/gpg.conf' are not yet active during this run |
| | 14 | gpg: keyring `/home/guest/.gnupg/secring.gpg' created |
| | 15 | gpg: keyring `/home/guest/.gnupg/pubring.gpg' created |
| | 16 | Please select what kind of key you want: |
| | 17 | (1) RSA and RSA (default) |
| | 18 | (2) DSA and Elgamal |
| | 19 | (3) DSA (sign only) |
| | 20 | (4) RSA (sign only) |
| | 21 | Your selection? 1 |
| | 22 | RSA keys may be between 1024 and 4096 bits long. |
| | 23 | What keysize do you want? (2048) |
| | 24 | Requested keysize is 2048 bits |
| | 25 | Please specify how long the key should be valid. |
| | 26 | 0 = key does not expire |
| | 27 | <n> = key expires in n days |
| | 28 | <n>w = key expires in n weeks |
| | 29 | <n>m = key expires in n months |
| | 30 | <n>y = key expires in n years |
| | 31 | Key is valid for? (0) 1y |
| | 32 | Key expires at Tue 25 Jun 2013 04:15:11 PM EDT |
| | 33 | Is this correct? (y/N) y |
| | 34 | |
| | 35 | You need a user ID to identify your key; the software constructs the user ID |
| | 36 | from the Real Name, Comment and Email Address in this form: |
| | 37 | "Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>" |
| | 38 | |
| | 39 | Real name: Test User |
| | 40 | Email address: test@example.org |
| | 41 | Comment: |
| | 42 | You selected this USER-ID: |
| | 43 | "Test User <test@example.org>" |
| | 44 | |
| | 45 | Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O |
| | 46 | You need a Passphrase to protect your secret key. |
| | 47 | |
| | 48 | We need to generate a lot of random bytes. It is a good idea to perform |
| | 49 | some other action (type on the keyboard, move the mouse, utilize the |
| | 50 | disks) during the prime generation; this gives the random number |
| | 51 | generator a better chance to gain enough entropy. |
| | 52 | ..+++++ |
| | 53 | +++++ |
| | 54 | We need to generate a lot of random bytes. It is a good idea to perform |
| | 55 | some other action (type on the keyboard, move the mouse, utilize the |
| | 56 | disks) during the prime generation; this gives the random number |
| | 57 | generator a better chance to gain enough entropy. |
| | 58 | .+++++ |
| | 59 | ....+++++ |
| | 60 | gpg: /home/guest/.gnupg/trustdb.gpg: trustdb created |
| | 61 | gpg: key CCFAE189 marked as ultimately trusted |
| | 62 | public and secret key created and signed. |
| | 63 | |
| | 64 | gpg: checking the trustdb |
| | 65 | gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model |
| | 66 | gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u |
| | 67 | gpg: next trustdb check due at 2013-06-25 |
| | 68 | pub 2048R/CCFAE189 2012-06-25 [expires: 2013-06-25] |
| | 69 | Key fingerprint = 7C3C D023 3427 8195 4CD6 F59E 8ADA A534 CCFA E189 |
| | 70 | uid Test User <test@example.org> |
| | 71 | sub 2048R/E37D6467 2012-06-25 [expires: 2013-06-25] |
| | 72 | |
| | 73 | 0 guest@animal:~$ |
| | 74 | }}} |
| | 75 | |
| | 76 | == Publish the key == |
| | 77 | |
| | 78 | gpg --send-key CCFAE189 |
| | 79 | |
| | 80 | == Find a public key == |
| | 81 | |
| | 82 | {{{ |
| | 83 | 0 guest@animal:~$ gpg --search jamie@mayfirst.org |
| | 84 | gpg: searching for "jamie@mayfirst.org" from hkp server keys.gnupg.net |
| | 85 | (1) Jamie McClelland <jm@mayfirst.org> |
| | 86 | Jamie McClelland <jamie@mayfirst.org> |
| | 87 | Jamie McClelland <jamie@progressivetech.org> |
| | 88 | 4096 bit RSA key 5F2E4935, created: 2009-05-10 |
| | 89 | (2) Jamie McClelland <jm@mayfirst.org> |
| | 90 | Jamie McClelland <jamie@mayfirst.org> |
| | 91 | Jamie McClelland <jamie@mediajumpstart.org> |
| | 92 | 1024 bit DSA key 76CC057D, created: 2004-01-23 |
| | 93 | Keys 1-2 of 2 for "jamie@mayfirst.org". Enter number(s), N)ext, or Q)uit > 1 |
| | 94 | gpg: requesting key 5F2E4935 from hkp server keys.gnupg.net |
| | 95 | gpg: key 5F2E4935: public key "Jamie McClelland <jamie@mayfirst.org>" imported |
| | 96 | gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model |
| | 97 | gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u |
| | 98 | gpg: next trustdb check due at 2013-06-25 |
| | 99 | gpg: Total number processed: 1 |
| | 100 | gpg: imported: 1 (RSA: 1) |
| | 101 | 0 guest@animal:~$ |
| | 102 | }}} |
| | 103 | |