pgp.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sun, 29 Nov 2015 19:52:44 +0200
changeset 1792 76efdcf0aa3e
child 1796 c15cf5f1132c
permissions -rw-r--r--
Dump content of key or signture.

.. -*- coding: utf-8; -*-
.. include:: HEADER.rst

==========
 PGP/GPG.
==========
.. contents::

What preffered client?
======================

GNU gpg.

How import keys from key-server?
================================
::

  $  gpg --keyserver pgp.mit.edu --recv-keys $KEYID

How mark key as trusted?
========================
::

  $ gpg --edit-key $KEYID trust

How export key?
===============
::

  $ gpg -a --export $KEYID >$FILE.asc
  $ gpg --output $PRIVKEY.gpg --armor --export-secret-key $KEYID

How create own PGP key?
=======================
::

  $ gpg --gen-key   # answer the question
  ...
  $ gpg -o $keyfile --export-secret-keys $NAME

How import keys from file?
==========================
::

  $ gpg --import $keyfile

How submit public key to key server?
====================================
::

  $ gpg --keyserver pgp.mit.edu --send-key $KEYID

What keys in local db?
======================
::

  $ gpg --list-keys
  $ gpg --list-keys $KEYID
  $ gpg --list-keys $EMAIL

  $ gpg --list-secret-keys

How delete key?
===============
::

  $ gpg --delete-key $KEYID
  $ gpg --delete-key $USER
  $ gpg --delete-key $EMAIL

  $ gpg --delete-secret-key $KEYID

Dump content of key or signture.
================================
::

  $ gpg --list-packets $FILE.sig
  $ gpg --list-packets $FILE.key

  $ sudo apt-get install pgpdump
  $ pgpdump $FILE.sig
  $ pgpdump $FILE.key

How sign file?
==============

To sign with first key::

  $ gpg -o $file.sig --sign $file
  $ gpg --default-key $NAME -o $file.sig --sign $file
  $ gpg -u ${USER_NAME} -o $file.sig --sign $file

How verify signature?
=====================
::

  $ gpg --verify $file.sig