Simplest Enterprise Continuous Integration Solutions

Saturday, October 6, 2012

Enterprise Linux: Generate GPG key

[buildmaster@linux64-rpm-build-server ~]$ cd
[buildmaster@linux64-rpm-build-server ~]$ mkdir .gnupg
[buildmaster@linux64-rpm-build-server ~]$ gpg --gen-key
gpg (GnuPG) 1.4.5; Copyright (C) 2006 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.

gpg: keyring `/home/buildmaster/.gnupg/secring.gpg' created
gpg: keyring `/home/buildmaster/.gnupg/pubring.gpg' created
Please select what kind of key you want:
   (1) DSA and Elgamal (default)
   (2) DSA (sign only)
   (5) RSA (sign only)
Your selection? 1
DSA keypair will have 1024 bits.
ELG-E keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048)
Requested keysize is 2048 bits
Please specify how long the key should be valid.
         0 = key does not expire
      <n>  = key expires in n days
      <n>w = key expires in n weeks
      <n>m = key expires in n months
      <n>y = key expires in n years
Key is valid for? (0)
Key does not expire at all
Is this correct? (y/N) y

You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and Email Address in this form:
    "Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>"

Real name: Build Master
Email address: buildmaster@my-company-name.com
Comment: RPM Development
You selected this USER-ID:
    "Build Master (RPM Development) <buildmaster@my-company-name.com>"

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
You need a Passphrase to protect your secret key.<your_gpg_secret_key>

We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
++++++++++.+++++++++++++++.+++++++++++++++++++++++++++++++++++.+++++++++++++++.++++++++++.+++++.++++++++++++++++++++++++++++++++++++++++>++++++++++.............<+++++......................>+++++..............+++++
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
.+++++++++++++++++++++++++.....+++++.+++++.+++++++++++++++.+++++.+++++.++++++++++++++++++++...+++++++++++++++.+++++++++++++++.++++++++++++++++++++++++++++++++++++++++>+++++>.+++++<+++++...............................>+++++.......<..+++++..+++++^^^
gpg: /home/buildmaster/.gnupg/trustdb.gpg: trustdb created
gpg: key 49A8C4DE marked as ultimately trusted
public and secret key created and signed.

gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
pub   1024D/49A8C4DE 2012-05-26
      Key fingerprint = 914C 356A 2C59 3FE1 C602  B650 9A8F 0821 49A8 C4DE
uid                  Build Master <buildmaster@my-company-name.com>
sub   2048g/60FA8C11 2012-05-26

[buildmaster@linux64-rpm-build-server ~]$
[buildmaster@linux64-rpm-build-server ~]$ gpg --list-keys
/home/buildmaster/.gnupg/pubring.gpg
---------------------------------
pub   1024D/49A8C4DE 2012-05-26
uid                  Build Master <buildmaster@my-company-name.com>
sub   2048g/60FA8C11 2012-05-26

[buildmaster@linux64-rpm-build-server ~]$ gpg --export -a 'Build Master' > MYCOMPANY-RPM-GPG-KEY
[buildmaster@linux64-rpm-build-server ~]$ file MYCOMPANY-RPM-GPG-KEY
MYCOMPANY-RPM-GPG-KEY: PGP armored data public key block
[buildmaster@linux64-rpm-build-server ~]$ echo "%_signature gpg" >> ~/.rpmmacros
[buildmaster@linux64-rpm-build-server ~]$ echo "%_gpg_name  Build Master" >> ~/.rpmmacros
[buildmaster@linux64-rpm-build-server ~]$ cat ~/.rpmmacros
%_signature gpg
%_gpg_name  Build Master

No comments:

Post a Comment