summaryrefslogtreecommitdiff
path: root/lib/KeyRing/Types.hs
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-07-02 03:50:22 -0400
committerJoe Crayne <joe@jerkface.net>2019-07-02 03:50:22 -0400
commite69f4750ceb30ba6e1953ce746d00ad4bc89145f (patch)
tree1559e25d58adcb4390cd992c7b5cab3cb9255748 /lib/KeyRing/Types.hs
parentb472f10fb19182deb4c081940cd1e660a0287fe9 (diff)
Make KeyKey a proper type.
Diffstat (limited to 'lib/KeyRing/Types.hs')
-rw-r--r--lib/KeyRing/Types.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/KeyRing/Types.hs b/lib/KeyRing/Types.hs
index e1e19f5..f5fd879 100644
--- a/lib/KeyRing/Types.hs
+++ b/lib/KeyRing/Types.hs
@@ -299,10 +299,11 @@ data InputFileContext = InputFileContext
299-- which is used for finger-printing and as a lookup key into 299-- which is used for finger-printing and as a lookup key into
300-- maps. This type may be changed to an actual fingerprint in 300-- maps. This type may be changed to an actual fingerprint in
301-- in the future. 301-- in the future.
302type KeyKey = [(Char,MPI)] 302newtype KeyKey = KeyKey [(Char,MPI)]
303 deriving (Eq,Ord,Show)
303 304
304keykey :: Packet -> KeyKey 305keykey :: Packet -> KeyKey
305keykey k = concatMap (\c -> (maybeToList $ find (\(f,x) -> f==c) (key k))) (public_key_fields $ key_algorithm k) 306keykey k = KeyKey $ concatMap (\c -> (maybeToList $ find (\(f,x) -> f==c) (key k))) (public_key_fields $ key_algorithm k)
306 307
307isKey :: Packet -> Bool 308isKey :: Packet -> Bool
308isKey (PublicKeyPacket {}) = True 309isKey (PublicKeyPacket {}) = True