PGP Public Key Server

De Linuxmemo.


[modifier] APT-KEY via proxy http

Souvent nous n'avons que la "short KeyID": exemple "ACCAF35C"

Dans ce cas, nous n'avons pas d'autres choix que d'essayer de récupérer toutes les clés pour cet identifiant, et voir s'il y a une collision.
(et l'espoir que personne ne se cache derriere la véritable clé, et qu'il n'y a pas de feinte).

Mais où obtenir la "long KeyID" ?

Il faut ajouter 0x la la clef courte dans la recherche afin d'obtenir toutes les clefs.
(This option takes values short or 0xshort for short key IDs (without or with 0x prefixed to indicate that it is a hex number) and long or 0xlong for long key IDs)

http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xACCAF35C
Search results for '0xaccaf35c'
Type bits/keyID     cr. time   exp time   key expir
pub  2048R/ACCAF35C 2012-09-10            
Fingerprint=AEEB 94E9 C5A3 B54E CFA4  A66A A684 470C ACCA F35C 
uid Insynchq Inc <services@insynchq.com>
sig  sig3  ACCAF35C 2012-09-10 __________ 2016-09-10 [selfsig]
sig  sig3  ACCAF35C 2016-09-11 __________ 2020-09-10 [selfsig]
sub  2048R/02DFE7E7 2012-09-10            
sig sbind  ACCAF35C 2012-09-10 __________ 2016-09-10 []
sig sbind  ACCAF35C 2016-09-11 __________ 2020-09-10 []

Dans ce cas, il n'y a qu'une seule clef...mais si il y en a plusieurs, c'est a vous de choisir la bonne clef.

Un fois votre choix fait, il suffit de cliquer sur pub "2048R/ACCAF35C 2012-09-10" pour avoir la "long KeyID":

http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xA684470CACCAF35C

Importer la clé

wget -O- "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xA684470CACCAF35C" | sudo apt-key add -

ou

gpg --keyserver keyserver.ubuntu.com --recv-keys  votre_n°_de_clé
gpg -a --export votre_n°_de_clé | sudo apt-key add -

Ref:

http://security.stackexchange.com/questions/84280/short-openpgp-key-ids-are-insecure-how-to-configure-gnupg-to-use-long-key-ids-i
https://www.didisoft.com/net-openpgp-library/long-hex-key-ids-pgp-net/

[modifier] PPA key via http proxy

Pas besoin d'importer la clé, add-apt-repository s'en charge.

  • Vérifier les variables d'env
env | grep -i proxy
  • Installer le repository (attetion "sudo -E")
sudo -E add-apt-repository ppa:atareao/atareao
Outils personnels