diff options
Diffstat (limited to 'kiki.hs')
-rw-r--r-- | kiki.hs | 24 |
1 files changed, 16 insertions, 8 deletions
@@ -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 () |
691 | sync bExport bSecret cmdarg args_raw = do | 691 | sync 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 | ||
788 | kiki "sync-secret" args_raw = | 788 | kiki "sync-secret" args_raw = |
789 | sync True True "sync-secret" args_raw | 789 | sync True True True "sync-secret" args_raw |
790 | 790 | ||
791 | kiki "sync-public" args_raw = | 791 | kiki "sync-public" args_raw = |
792 | sync True False "sync-public" args_raw | 792 | sync True True False "sync-public" args_raw |
793 | 793 | ||
794 | kiki "import-secret" args_raw = | 794 | kiki "import-secret" args_raw = |
795 | sync False True "import-secret" args_raw | 795 | sync False True True "import-secret" args_raw |
796 | 796 | ||
797 | kiki "import-public" args_raw = | 797 | kiki "import-public" args_raw = |
798 | sync False False "import-public" args_raw | 798 | sync False True False "import-public" args_raw |
799 | |||
800 | kiki "export-secret" args_raw = | ||
801 | sync True False True "export-secret" args_raw | ||
802 | |||
803 | kiki "export-public" args_raw = | ||
804 | sync True False False "export-public" args_raw | ||
799 | 805 | ||
800 | kiki "working-key" args = do | 806 | kiki "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 | ||