|
|
|
@ -286,15 +286,13 @@ def collect_packets(packets, types_to_collect):
|
|
|
|
|
return result
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def parse_public_key(stream):
|
|
|
|
|
def parse_public_keys(stream):
|
|
|
|
|
"""Parse GPG public key into hierarchy of packets."""
|
|
|
|
|
packets = list(parse_packets(stream))
|
|
|
|
|
packets = collect_packets(packets, {'signature'})
|
|
|
|
|
packets = collect_packets(packets, {'user_id', 'user_attribute'})
|
|
|
|
|
packets = collect_packets(packets, {'subkey'})
|
|
|
|
|
if len(packets) != 1:
|
|
|
|
|
raise ValueError('Unexpected packet structure: %r', packets)
|
|
|
|
|
return packets[0]
|
|
|
|
|
return packets
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HASH_ALGORITHMS = {
|
|
|
|
|