From bd6992f90dea2425190efa048eafdda27ac84456 Mon Sep 17 00:00:00 2001 From: joe Date: Sat, 26 Apr 2014 18:14:23 -0400 Subject: removed --keypairs and --wallets from *-public commands. --- kiki.hs | 139 +++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 72 insertions(+), 67 deletions(-) diff --git a/kiki.hs b/kiki.hs index e551dbd..b3fa330 100644 --- a/kiki.hs +++ b/kiki.hs @@ -459,7 +459,7 @@ whoseKey rsakey db = filter matchkey (Map.elems db) -kiki_usage cmd = putStr $ +kiki_usage bSecret cmd = putStr $ case cmd of "sync-secret" -> unlines ["kiki sync-secret [options...]" @@ -520,33 +520,36 @@ kiki_usage cmd = putStr $ ," Provide keyring files other than the implicit secring.gpg and" ," pubring.gpg in the --homedir. This option is implicit unless" ," --keypairs or --wallets is used." - ,"" - ," --wallets FILE FILE..." - ," Provide wallet files with secret crypto-coin keys in Wallet" - ," Import Format. The keys will be treated as subkeys of your" - ," current working key (the one shown by --show-wk)." - ,"" - ," --keypairs KEYSPEC 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" - ," format. Users incognisant of the fact that the public key (which" - ," is also stored separately) is in this file, often think of it as" - ," their secret key file." - ,"" - ," Each KEYSPEC specifies that a key should match the content and" - ," timestamp of an external PKCS #1 private RSA key file." - ," " - ," KEYSPEC ::= SPEC=FILE{CMD} " - ,"" - ," The form of SPEC is documented below. If there is only one master" - ," key in your keyring and only one key is used for each purpose, then" - ," it is possible for SPEC in this case to merely be a tag which offers" - ," information about what this key is used for, for example, any of" - ," `tor', `ssh-client', `ssh-host', or `strongswan' will do." - ,"" - ," If neither SPEC or FILE match any keys, then the CMD will be " - ," executed in order to create the FILE." - ,"" + ,""] + ++ do + guard bSecret + unlines + [" --wallets FILE FILE..." + ," Provide wallet files with secret crypto-coin keys in Wallet" + ," Import Format. The keys will be treated as subkeys of your" + ," current working key (the one shown by --show-wk)." + ,"" + ," --keypairs KEYSPEC 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" + ," format. Users incognisant of the fact that the public key (which" + ," is also stored separately) is in this file, often think of it as" + ," their secret key file." + ,"" + ," Each KEYSPEC specifies that a key should match the content and" + ," timestamp of an external PKCS #1 private RSA key file." + ," " + ," KEYSPEC ::= SPEC=FILE{CMD} " + ,"" + ," The form of SPEC is documented below. If there is only one master" + ," key in your keyring and only one key is used for each purpose, then" + ," it is possible for SPEC in this case to merely be a tag which offers" + ," information about what this key is used for, for example, any of" + ," `tor', `ssh-client', `ssh-host', or `strongswan' will do." + ,"" + ," If neither SPEC or FILE match any keys, then the CMD will be " + ," executed in order to create the FILE." + ,""] {- ,"Output:" ," --show-wk Show fingerprints for the working key (which will be used to" ," make signatures) and all its subkeys and UID." @@ -573,41 +576,43 @@ kiki_usage cmd = putStr $ ," --help Shows this help screen." ,"" -} - ,"Specifying keys on the kiki command line:" - ,"" - ," SPEC ::= MASTER/SUBKEY" - ,"" - ," SPEC indicates a specific key in the keyring, in it's longest incarnation," - ," it is of the form MASTER/SUBKEY where MASTER and SUBKEY are documented below." - ," If kiki can infer the key unambiguously, either via the command in question or" - ," the contents of the keyring, then it is permissable to ommit either MASTER or" - ," SUBKEY, in which case the slash may also be ommitted unless it is used via its" - ," position to indicate whether a SUBKEY or MASTER is intended." - ,"" - ," MASTER may be any of" - ," * The tail end of a fingerprint prefixed by 'fp:'" - ," * A sub-string of a user id (without slashes) prefixed by 'u:'" - ," * 40 characters of hexidecimal (kiki will assume this to be a fingerprint)" - ," * A sub-string of a user id (without slashes, the prefix 'u:' is optional)" - ,"" - ," SUBKEY may be any of" - ," * The tail end of a fingerprint prefixed by 'fp:'" - ," * An exact match of a usage tag prefixed by 't:'" - ," * 40 characters of hexidecimal (kiki will assume this to be a fingerprint)" - ," * An exact match of a usage tag (The prefix 't:' is optional)" - ,"" - ," In parsing the spec, kiki will attempt to match the string to one of the" - ," above formats, in the order presented." - ,"" - ," Examples of valid SPEC strings:" - ,"" - ," fp:4A39F/tor" - ," u:joe/tor" - ," u:joe/t:tor" - ," u:joe/fp:4abf30" - ," joe/tor" - ," 5E24CD442AA6965D2012E62A905C24185D5379C2" - ] + ++ + unlines + ["Specifying keys on the kiki command line:" + ,"" + ," SPEC ::= MASTER/SUBKEY" + ,"" + ," SPEC indicates a specific key in the keyring, in it's longest incarnation," + ," it is of the form MASTER/SUBKEY where MASTER and SUBKEY are documented below." + ," If kiki can infer the key unambiguously, either via the command in question or" + ," the contents of the keyring, then it is permissable to ommit either MASTER or" + ," SUBKEY, in which case the slash may also be ommitted unless it is used via its" + ," position to indicate whether a SUBKEY or MASTER is intended." + ,"" + ," MASTER may be any of" + ," * The tail end of a fingerprint prefixed by 'fp:'" + ," * A sub-string of a user id (without slashes) prefixed by 'u:'" + ," * 40 characters of hexidecimal (kiki will assume this to be a fingerprint)" + ," * A sub-string of a user id (without slashes, the prefix 'u:' is optional)" + ,"" + ," SUBKEY may be any of" + ," * The tail end of a fingerprint prefixed by 'fp:'" + ," * An exact match of a usage tag prefixed by 't:'" + ," * 40 characters of hexidecimal (kiki will assume this to be a fingerprint)" + ," * An exact match of a usage tag (The prefix 't:' is optional)" + ,"" + ," In parsing the spec, kiki will attempt to match the string to one of the" + ," above formats, in the order presented." + ,"" + ," Examples of valid SPEC strings:" + ,"" + ," fp:4A39F/tor" + ," u:joe/tor" + ," u:joe/t:tor" + ," u:joe/fp:4abf30" + ," joe/tor" + ," 5E24CD442AA6965D2012E62A905C24185D5379C2" + ] doAutosign rt kd@(KeyData k ksigs umap submap) = ops where @@ -703,9 +708,9 @@ sync bExport bImport bSecret cmdarg args_raw = do , ("--help",0) ] polyVariadicArgs = ["--keyrings" - ,"--keypairs" - ,"--wallets" - ,"--hosts"] + ,"--hosts" ] + ++ do guard bSecret + [ "--keypairs", "--wallets" ] -- putStrLn $ "margs = " ++ show (Map.assocs margs) unkeysRef <- newIORef Map.empty pwRef <- newIORef Nothing @@ -763,7 +768,7 @@ sync bExport bImport bSecret cmdarg args_raw = do , homeSpec = homespec } - (\f -> maybe f (const $ kiki_usage cmdarg) $ Map.lookup "--help" margs) $ do + (\f -> maybe f (const $ kiki_usage bSecret cmdarg) $ Map.lookup "--help" margs) $ do KikiResult rt report <- runKeyRing kikiOp case rt of -- cgit v1.2.3