summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2014-04-28 23:22:39 -0400
committerjoe <joe@jerkface.net>2014-04-28 23:22:39 -0400
commitd83e738f6e409964d5472ac1dc2becced6416782 (patch)
tree90d5b3904fda0bd9fe479864618edaf2fdfdc9f3
parentf908a784c9a077e18ea9ea50d13e65b4233def7e (diff)
documented KeyFilter
-rw-r--r--KeyRing.hs25
1 files changed, 14 insertions, 11 deletions
diff --git a/KeyRing.hs b/KeyRing.hs
index c14343f..09fa19c 100644
--- a/KeyRing.hs
+++ b/KeyRing.hs
@@ -175,9 +175,14 @@ data Access = AutoAccess -- ^ secret or public as appropriate based on existing
175 | Sec -- ^ secret information 175 | Sec -- ^ secret information
176 | Pub -- ^ public information 176 | Pub -- ^ public information
177 177
178-- | TODO: Implement keyfilters other than KF_None and KF_All 178data KeyFilter = KF_None -- ^ No keys will be imported.
179-- This should make kImports obsolete. 179 | KF_Match String -- ^ Only the key that matches the spec will be imported.
180data KeyFilter = KF_None | KF_Match String | KF_Subkeys | KF_Authentic | KF_All 180 | KF_Subkeys -- ^ Subkeys will be imported if their owner key is
181 -- already in the ring. TODO: Even if their signatures
182 -- are bad?
183 | KF_Authentic -- ^ Keys are imported if they belong to an authenticated
184 -- identity (signed or self-authenticating).
185 | KF_All -- ^ All keys will be imported.
181 186
182data StreamInfo = StreamInfo 187data StreamInfo = StreamInfo
183 { access :: Access 188 { access :: Access
@@ -234,14 +239,6 @@ noManip _ _ = []
234data KeyRingOperation = KeyRingOperation 239data KeyRingOperation = KeyRingOperation
235 { kFiles :: Map.Map InputFile StreamInfo 240 { kFiles :: Map.Map InputFile StreamInfo
236 , kImports :: Map.Map InputFile (KeyRingRuntime -> KeyData -> Maybe Bool) 241 , kImports :: Map.Map InputFile (KeyRingRuntime -> KeyData -> Maybe Bool)
237 -- ^
238 -- Indicates what pgp master keys get written to which keyring files.
239 -- Just True = import public key
240 -- Just False = import secret key
241 -- Nothing = do not import
242 -- Note that subkeys will always be imported if their owner key is
243 -- already in the ring.
244 -- TODO: Even if their signatures are bad?
245 , kManip :: KeyRingRuntime -> KeyData -> [PacketUpdate]--[KeyRingAddress PacketUpdate] 242 , kManip :: KeyRingRuntime -> KeyData -> [PacketUpdate]--[KeyRingAddress PacketUpdate]
246 , homeSpec :: Maybe String 243 , homeSpec :: Maybe String
247 } 244 }
@@ -1301,12 +1298,18 @@ showPacket p | isKey p = (if is_subkey p
1301showPacket0 p = concat . take 1 $ words (show p) 1298showPacket0 p = concat . take 1 $ words (show p)
1302 1299
1303 1300
1301-- | returns Just True so as to indicate that
1302-- the public portions of keys will be imported
1304importPublic :: Maybe Bool 1303importPublic :: Maybe Bool
1305importPublic = Just True 1304importPublic = Just True
1306 1305
1306-- | returns False True so as to indicate that
1307-- the public portions of keys will be imported
1307importSecret :: Maybe Bool 1308importSecret :: Maybe Bool
1308importSecret = Just False 1309importSecret = Just False
1309 1310
1311-- | returns Nothing to indicate that no new master
1312-- keys will be imported.
1310subkeysOnly :: Maybe Bool 1313subkeysOnly :: Maybe Bool
1311subkeysOnly = Nothing 1314subkeysOnly = Nothing
1312 1315