From 5000de4f1079004fa398e4b129896f5e59e9c9df Mon Sep 17 00:00:00 2001 From: joe Date: Sat, 23 Apr 2016 21:13:40 -0400 Subject: Added --keypairs support to export-public. --- kiki.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'kiki.hs') diff --git a/kiki.hs b/kiki.hs index 7c0c4b2..8ee88c6 100644 --- a/kiki.hs +++ b/kiki.hs @@ -804,8 +804,7 @@ documentAutoSignFlag bExport bImport bSecret = ," 'tor' subkey corresponding to the address HOSTNAME.onion." ,""] documentKeyPairsOption :: Bool -> Bool -> Bool -> [String] -documentKeyPairsOption bExport bImport False = [] -documentKeyPairsOption bExport bImport bSecret@True = +documentKeyPairsOption bExport bImport bSecret = [" --keypairs [KEYSPEC ...]" ," A keypair is a secret key coupled with it's corresponding public" ," key, both of which are ordinarily stored in a single file in PEM" @@ -1041,7 +1040,7 @@ buildStreamInfo rtyp ftyp = StreamInfo { typ = ftyp -- bImport: --import and --import-if-authentic sync :: Bool -> Bool -> Bool -> String -> [String] -> IO () sync bExport bImport bSecret cmdarg args_raw = do - let (sargs,margs) = processArgs sargspec polyVariadicArgs "--keyrings" args_raw + let (sargs,margs) = processArgs sargspec polyVariadicArgs "--keypairs" args_raw sargspec = [ ("--show-wk",0) , ("--autosign",0) {-, ("--show-all",0) @@ -1054,9 +1053,10 @@ sync bExport bImport bSecret cmdarg args_raw = do ++ do guard bImport [ ("--import",0), ("--import-if-authentic",0) ] polyVariadicArgs = ["--keyrings" - ,"--hosts" ] + ,"--hosts" + ,"--keypairs"] ++ do guard bSecret - [ "--keypairs", "--wallets" ] + [ "--wallets" ] -- putStrLn $ "margs = " ++ show (Map.assocs margs) unkeysRef <- newIORef Map.empty pwRef <- newIORef Nothing @@ -1087,7 +1087,7 @@ sync bExport bImport bSecret cmdarg args_raw = do , typ = if "dns-" `isPrefixOf` usage then DNSPresentation else PEMFile - , access = Sec + , access = if bSecret then Sec else Pub , initializer = cmd' , transforms = [] } ) @@ -1121,7 +1121,7 @@ sync bExport bImport bSecret cmdarg args_raw = do KeyRingFile ) ] ++ rings - ++ if bSecret then pems else [] + ++ pems ++ if bSecret then walts else [] ++ hosts , opPassphrases = do pfile <- maybeToList passfd -- cgit v1.2.3