GNUPG: High Level Cryptography by The Golden Keys Team - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

 CHAPTER 12

 

 Importing and Exporting  Certificates

 

To export a certificate means to generate a copy of a certificate located in your keyring to a file where it could then be moved or sent to others. To import a certificate means to insert a certificate from a file or from the internet into your keyring where it can then be used.

 

To sign, verify, encrypt, decrypt and certify, you often need to import others' certificates, and export yours to them.

 

12.1 – Exporting certificates

 

12.1.1 – Exporting your public key

 

The public key is the key you make available for others to communicate with you. It is only through this key that others can contact you privately.

 

As it is located in your keyring, you first need to export it to a file, and then make this file available to others. To export your public key use the command below:

 

img130.png

 

Your public key has now been exported to the file mykey.asc.

 

You can give this file to other people by any means you wish: through CD/DVD­ROM disc, USB drive, send by e­mail, you can publish it in a key server in the internet or make it available for download in your website, blog or social network.

 

12.1.2 – Exporting your private key

 

The private key is your unique, personal and untransferable key, so you must never give it or send it to anyone. Ideally you should only export your private key to make a backup copy or to use it in another computer that you own.

 

To export your private key use the command below:

 

img131.png

 

Your key has now been exported to file mykey.asc

 

12.1.3 – Exporting your whole keyring

 

Normally your whole keyring would only be exported to transfer it to another machine or to do a backup copy. We will present you two different ways to do it:

 

Using a single file

 

This way you will first export your public keys to a file and then export the private keys to the same file by appending to it.

 

img132.png

 

Your keyring has now been exported to file keyring.asc.

 

Using two files

 

This way you will export your keyring to two different files, one containing the public keys and the other containing the private keys. It is recommended that you do it this way.

 

img133.png

 

Your keyring has now been exported to files pub_keyring.asc and sec_keyring.asc. Now when you want to import your keyring first import pub_keyring.asc and then sec_keyring.asc.

 

12.2 – Importing keys and certificates

 

12.2.1 – Importing certificates from a file

 

To import public keys, private keys, whole key rings. or certificates of any kind use the command below:

 

img134.png

Now your certificate is imported and ready to be used.

 

12.2.2 – Importing certificates from key servers

 

Check out chapter 17 for more information on this.