summaryrefslogtreecommitdiff
path: root/kiki.hs
diff options
context:
space:
mode:
Diffstat (limited to 'kiki.hs')
-rw-r--r--kiki.hs24
1 files changed, 16 insertions, 8 deletions
diff --git a/kiki.hs b/kiki.hs
index 555ca92..e551dbd 100644
--- a/kiki.hs
+++ b/kiki.hs
@@ -688,7 +688,7 @@ parseKeySpecs = map $ \specfile -> do
688 Just (spec,file,cmd) 688 Just (spec,file,cmd)
689 689
690--kiki :: (Eq a, Data.String.IsString a) => a -> [String] -> IO () 690--kiki :: (Eq a, Data.String.IsString a) => a -> [String] -> IO ()
691sync bExport bSecret cmdarg args_raw = do 691sync bExport bImport bSecret cmdarg args_raw = do
692 let (sargs,margs) = processArgs sargspec polyVariadicArgs "--keyrings" args_raw 692 let (sargs,margs) = processArgs sargspec polyVariadicArgs "--keyrings" args_raw
693 sargspec = [ ("--import",0) 693 sargspec = [ ("--import",0)
694 , ("--autosign",0) 694 , ("--autosign",0)
@@ -751,8 +751,8 @@ sync bExport bSecret cmdarg args_raw = do
751 return guardAuthentic 751 return guardAuthentic
752 kikiOp = KeyRingOperation 752 kikiOp = KeyRingOperation
753 { kFiles = Map.fromList $ 753 { kFiles = Map.fromList $
754 [ ( HomeSec, (if bSecret then MutableRef Nothing else ConstRef, KeyRingFile passfd) ) 754 [ ( HomeSec, (if bSecret && bImport then MutableRef Nothing else ConstRef, KeyRingFile passfd) )
755 , ( HomePub, (MutableRef Nothing, KeyRingFile Nothing) ) 755 , ( HomePub, (if bImport then MutableRef Nothing else ConstRef, KeyRingFile Nothing) )
756 ] 756 ]
757 ++ rings 757 ++ rings
758 ++ if bSecret then pems else [] 758 ++ if bSecret then pems else []
@@ -786,20 +786,26 @@ sync bExport bSecret cmdarg args_raw = do
786 putStrLn $ fname ++ ": " ++ reportString act 786 putStrLn $ fname ++ ": " ++ reportString act
787 787
788kiki "sync-secret" args_raw = 788kiki "sync-secret" args_raw =
789 sync True True "sync-secret" args_raw 789 sync True True True "sync-secret" args_raw
790 790
791kiki "sync-public" args_raw = 791kiki "sync-public" args_raw =
792 sync True False "sync-public" args_raw 792 sync True True False "sync-public" args_raw
793 793
794kiki "import-secret" args_raw = 794kiki "import-secret" args_raw =
795 sync False True "import-secret" args_raw 795 sync False True True "import-secret" args_raw
796 796
797kiki "import-public" args_raw = 797kiki "import-public" args_raw =
798 sync False False "import-public" args_raw 798 sync False True False "import-public" args_raw
799
800kiki "export-secret" args_raw =
801 sync True False True "export-secret" args_raw
802
803kiki "export-public" args_raw =
804 sync True False False "export-public" args_raw
799 805
800kiki "working-key" args = do 806kiki "working-key" args = do
801 if "--help" `notElem` args 807 if "--help" `notElem` args
802 then sync False False "working-key" ["--show-wk"] 808 then sync False False False "working-key" ["--show-wk"]
803 else putStrLn $ 809 else putStrLn $
804 unlines ["working-key" 810 unlines ["working-key"
805 ,"" 811 ,""
@@ -833,6 +839,8 @@ commands =
833 , ( "sync-public", "update key files of various kinds by propogating public information" ) 839 , ( "sync-public", "update key files of various kinds by propogating public information" )
834 , ( "import-secret", "import (both public and secret) information into your keyring" ) 840 , ( "import-secret", "import (both public and secret) information into your keyring" )
835 , ( "import-public", "import (public) information into your keyring" ) 841 , ( "import-public", "import (public) information into your keyring" )
842 , ( "export-secret", "export (both public and secret) information into your keyring" )
843 , ( "export-public", "import (public) information into your keyring" )
836 , ( "working-key", "show the current working master key and its subkeys" ) 844 , ( "working-key", "show the current working master key and its subkeys" )
837 ] 845 ]
838 846