diff options
author | Clint Adams <clint@debian.org> | 2012-05-21 23:03:45 -0400 |
---|---|---|
committer | Stephen Paul Weber <singpolyma@singpolyma.net> | 2012-05-22 13:17:29 -0500 |
commit | 98b6518c73aaa805b991be548586d126f89b9bc0 (patch) | |
tree | c7f25cb8af6acf222e406f5ae6810f16971ea3bf /Data | |
parent | 4898b00a5221c9ceaa36d04ceea406bcdd12ccd8 (diff) |
Parse V3 pubkey packets.
Diffstat (limited to 'Data')
-rw-r--r-- | Data/OpenPGP.hs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Data/OpenPGP.hs b/Data/OpenPGP.hs index 4fd32e2..9ddb19f 100644 --- a/Data/OpenPGP.hs +++ b/Data/OpenPGP.hs | |||
@@ -505,6 +505,18 @@ parse_packet 5 = do | |||
505 | parse_packet 6 = do | 505 | parse_packet 6 = do |
506 | version <- get :: Get Word8 | 506 | version <- get :: Get Word8 |
507 | case version of | 507 | case version of |
508 | 3 -> do | ||
509 | timestamp <- get | ||
510 | _ <- get :: Get Word16 -- TODO: preserve days_of_validity somehow | ||
511 | algorithm <- get | ||
512 | key <- mapM (\f -> fmap ((,)f) get) (public_key_fields algorithm) | ||
513 | return PublicKeyPacket { | ||
514 | version = version, | ||
515 | timestamp = timestamp, | ||
516 | key_algorithm = algorithm, | ||
517 | key = key, | ||
518 | is_subkey = False | ||
519 | } | ||
508 | 4 -> do | 520 | 4 -> do |
509 | timestamp <- get | 521 | timestamp <- get |
510 | algorithm <- get | 522 | algorithm <- get |