Algoritmos compatibles de llave GPG
GitHub Enterprise es compatible con varios algoritmos GPG. Si tratas de agregar una llave generada con un algoritmo no compatible, puedes llegar a un error.
- RSA
- ElGamal
- DSA
- ECDH
- ECDSA
- EdDSA
Generating a GPG key
Note: Before generating a new GPG key, make sure you've verified your email address. If you haven't verified your email address, you won't be able to sign commits and tags with GPG.
-
Download and install the GPG command line tools for your operating system. We generally recommend installing the latest version for your operating system.
-
Abre la TerminalTerminalGit Bash.
-
Generate a GPG key pair. Since there are multiple versions of GPG, you may need to consult the relevant man page to find the appropriate key generation command. Your key must use RSA.
- If you are on version 2.1.17 or greater, paste the text below to generate a GPG key pair.
$ gpg --full-generate-key - If you are not on version 2.1.17 or greater, the
gpg --full-generate-keycommand doesn't work. Paste the text below and skip to step 6.$ gpg --default-new-key-algo rsa4096 --gen-key
- If you are on version 2.1.17 or greater, paste the text below to generate a GPG key pair.
-
At the prompt, specify the kind of key you want, or press
Enterto accept the defaultRSA and RSA. -
Enter the desired key size. Your key must be at least
4096bits. -
Enter the length of time the key should be valid. Press
Enterto specify the default selection, indicating that the key doesn't expire. -
Verify that your selections are correct.
-
Enter your user ID information.
Note: When asked to enter your email address, ensure that you enter the verified email address for your GitHub account.
-
Type a secure passphrase.
-
Utiliza el comando
gpg --list-secret-keys --keyid-format LONGpara enumerar las llaves GPG para las cuales tienes tanto una llave pública como privada. Se requiere una llave privada para registrar confirmaciones o etiquetas.$ gpg --list-secret-keys --keyid-format LONGNota: Algunas instalaciones GPG en Linux pueden requerir que uses
gpg2 --list-keys --keyid-format LONGpara visualizar una lista de tus llaves existentes en su lugar. En este caso también deberás configurar Git para que usegpg2by runninggit config --global gpg.program gpg2. -
De la lista de llaves GPG, copia la ID de la llave GPG que quieres utilizar. En este ejemplo, el ID de la llave GPG es
3AA5C34371567BD2:$ gpg --list-secret-keys --keyid-format LONG /Users/hubot/.gnupg/secring.gpg ------------------------------------ sec 4096R/3AA5C34371567BD2 2016-03-10 [expires: 2017-03-10] uid Hubotssb 4096R/42B317FD4BA89E7A 2016-03-10 -
Paste the text below, substituting in the GPG key ID you'd like to use. In this example, the GPG key ID is
3AA5C34371567BD2:$ gpg --armor --export 3AA5C34371567BD2 # Prints the GPG key ID, in ASCII armor format -
Copy your GPG key, beginning with
-----BEGIN PGP PUBLIC KEY BLOCK-----and ending with-----END PGP PUBLIC KEY BLOCK-----.