diff options
author | Joe Crayne <joe@jerkface.net> | 2019-07-02 03:50:22 -0400 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2019-07-02 03:50:22 -0400 |
commit | e69f4750ceb30ba6e1953ce746d00ad4bc89145f (patch) | |
tree | 1559e25d58adcb4390cd992c7b5cab3cb9255748 /lib/KeyRing/Types.hs | |
parent | b472f10fb19182deb4c081940cd1e660a0287fe9 (diff) |
Make KeyKey a proper type.
Diffstat (limited to 'lib/KeyRing/Types.hs')
-rw-r--r-- | lib/KeyRing/Types.hs | 5 |
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. |
302 | type KeyKey = [(Char,MPI)] | 302 | newtype KeyKey = KeyKey [(Char,MPI)] |
303 | deriving (Eq,Ord,Show) | ||
303 | 304 | ||
304 | keykey :: Packet -> KeyKey | 305 | keykey :: Packet -> KeyKey |
305 | keykey k = concatMap (\c -> (maybeToList $ find (\(f,x) -> f==c) (key k))) (public_key_fields $ key_algorithm k) | 306 | keykey k = KeyKey $ concatMap (\c -> (maybeToList $ find (\(f,x) -> f==c) (key k))) (public_key_fields $ key_algorithm k) |
306 | 307 | ||
307 | isKey :: Packet -> Bool | 308 | isKey :: Packet -> Bool |
308 | isKey (PublicKeyPacket {}) = True | 309 | isKey (PublicKeyPacket {}) = True |