Add PGPPacket._str_generic_key_packet and fingerprint calculation
authorW. Trevor King <wking@tremily.us>
Fri, 20 Dec 2013 19:54:13 +0000 (11:54 -0800)
committerW. Trevor King <wking@tremily.us>
Fri, 20 Dec 2013 23:18:13 +0000 (15:18 -0800)
commitdc27b03c201aa70a3f41c22b8a7d05cbc2311ed7
treebc2fb635eba55449436da1c5815851c41425dbf6
parent0958c0ddf71564391d664e36adc782f43d89291f
Add PGPPacket._str_generic_key_packet and fingerprint calculation

From RFC 4880 [1]:

  A V4 fingerprint is the 160-bit SHA-1 hash of the octet 0x99,
  followed by the two-octet packet length, followed by the entire
  Public-Key packet starting with the version field.  The Key ID is
  the low-order 64 bits of the fingerprint.

Since all key types (public/private and primary/subkey) have the same
generic public key portion, we can use the same stringification method
for all types.

[1]: http://tools.ietf.org/search/rfc4880#section-12.2
gpg-migrate.py