9

I am unable to get GPG signing keys. Please any one tell me. Thanks enter image description here How to generate gps signing keys in windows for jcenter

Dror Bereznitsky
  • 20,048
  • 3
  • 48
  • 57
Krishna
  • 1,556
  • 13
  • 21
  • 1
    This tutorial was useful: https://inthecheesefactory.com/blog/how-to-upload-library-to-jcenter-maven-central-as-dependency/en – Suragch May 13 '17 at 08:41

4 Answers4

10

For Linux/Mac you can use gpg. I learned how to do this here. I needed to prefix the following commands with sudo.

  1. Generate the keys

    gpg --gen-key
    

    Follow the defaults but enter your name and email and optionally a password.

  2. List the keys.

    gpg --list-keys
    

    which should show something like this:

    pub   2038R/91E83BF2 2017-05-13
    uid                  Bob <name@example.com>
    sub   2038R/E3872671 2017-05-13
    
  3. Upload the public key to a keyserver

    gpg --keyserver hkp://pool.sks-keyservers.net --send-keys PUBLIC_KEY_ID
    

    replacing PUBLIC_KEY_ID with your id (91E83BF2 in the example above).

  4. Export your public and private keys to a text file

    gpg -a --export name@example.com > public_key_sender.asc
    gpg -a --export-secret-key name@example.com > private_key_sender.asc
    
  5. Copy the contents of these files to Bintray at Edit Profile > GPG signing.

enter image description here

Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
  • Also in console GPGsigning option is not there – Deep Patel Jun 05 '18 at 09:50
  • @DeepPatel, did you use `sudo`? – Suragch Jun 05 '18 at 13:06
  • 1
    I got "no route to host" for `hkp://pool.sks-keyservers.net` but was able to push to `hkp://ipv4.pool.sks-keyservers.net` – simbo1905 Jun 06 '18 at 19:59
  • 1
    gpg -a --export name@example.com > public_key_sender.asc What does this command do? I didnt recieve anything on my mail. – niranjan kurambhatti Aug 11 '18 at 22:58
  • @niranjankurambhatti i am also facing same issue that there in no any issue when i run the step 4 command but i haven't receive anything in mail. have you got the solution? – Ninja Oct 25 '18 at 10:08
  • @Ninja This doesn't send an email. It just creates a file called ‛public_key_sender.asc‛. – Suragch Oct 26 '18 at 10:55
  • @Ninja You dont recieve any mail. I got my key on the command prompt itself. – niranjan kurambhatti Oct 26 '18 at 11:10
  • @niranjankurambhatti ok, i got the solution from [here](https://www.deepdotweb.com/2015/02/21/pgp-tutorial-for-windows-kleopatra-gpg4win/) but i just want to know that from where we can find that key in our system ? – Ninja Oct 26 '18 at 11:15
  • `gpg: keyserver send failed: Network is unreachable` – Dr.jacky Nov 21 '20 at 21:21
  • @Suragch I've followed the same steps to generate the key but, the public ID is not 8 characters. It's something like `09AF53E4FCF6163E85FE9391F09001AB408F78CA` – Dr.jacky Nov 21 '20 at 21:30
  • 1
    @Dr.jacky, I don't recall why I wrote a short string for public id key in the examples above, but yes, replace it with the long one that you actually get. – Suragch Nov 22 '20 at 02:59
4

Windows users can generate GPG keys using GPG4Win.
There are many tutorials available, for example this one.

Dror Bereznitsky
  • 20,048
  • 3
  • 48
  • 57
0

Here is a nice tutorial for gen gpg-key https://help.github.com/articles/generating-a-new-gpg-key/

Some note

-For Ubuntu 14.04 we need to use gpg --gen-key instead of gpg --full-generate-key https://askubuntu.com/questions/1019793/how-to-solve-gpg-invalid-option-full-generate-key.

-For gen private key

gpg --armor --export-secret-keys {sec_value}
eg: gpg --armor --export-secret-keys 3AA5C34371567BD2

-When copy public key or private key, remember copy ALL (including -----BEGIN ...----- and -----END ...-----)

Linh
  • 57,942
  • 23
  • 262
  • 279
0

I found solution, I needed it configure gpg signing in bintray. If you not created gpg keys follow this tutorial: https://help.github.com/articles/generating-a-new-gpg-key/

After you created gpg keys if you do not know how to copy private key in armored form follow this steps on git bash:

  1. list private keys: gpg --list-secret-keys
  2. copy long string after(or below) [SC]
  3. export armored private key: gpg --export-secret-keys --armor string you have copied > private_key.asc
  4. open private_key.asc with some editor(i used sublime text), and copy your private key

Hope it helps

Ali
  • 2,702
  • 3
  • 32
  • 54
Mukhtar Bimurat
  • 356
  • 2
  • 18