diff options
Diffstat (limited to 'KeyRing.hs')
-rw-r--r-- | KeyRing.hs | 25 |
1 files changed, 14 insertions, 11 deletions
@@ -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 | 178 | data 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. |
180 | data 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 | ||
182 | data StreamInfo = StreamInfo | 187 | data StreamInfo = StreamInfo |
183 | { access :: Access | 188 | { access :: Access |
@@ -234,14 +239,6 @@ noManip _ _ = [] | |||
234 | data KeyRingOperation = KeyRingOperation | 239 | data 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 | |||
1301 | showPacket0 p = concat . take 1 $ words (show p) | 1298 | showPacket0 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 | ||
1304 | importPublic :: Maybe Bool | 1303 | importPublic :: Maybe Bool |
1305 | importPublic = Just True | 1304 | importPublic = Just True |
1306 | 1305 | ||
1306 | -- | returns False True so as to indicate that | ||
1307 | -- the public portions of keys will be imported | ||
1307 | importSecret :: Maybe Bool | 1308 | importSecret :: Maybe Bool |
1308 | importSecret = Just False | 1309 | importSecret = Just False |
1309 | 1310 | ||
1311 | -- | returns Nothing to indicate that no new master | ||
1312 | -- keys will be imported. | ||
1310 | subkeysOnly :: Maybe Bool | 1313 | subkeysOnly :: Maybe Bool |
1311 | subkeysOnly = Nothing | 1314 | subkeysOnly = Nothing |
1312 | 1315 | ||