summaryrefslogtreecommitdiff
path: root/kiki.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2014-04-26 18:14:23 -0400
committerjoe <joe@jerkface.net>2014-04-26 18:14:23 -0400
commitbd6992f90dea2425190efa048eafdda27ac84456 (patch)
treefde79b0037451e8f2aaf1295ddd0483b41c2b10b /kiki.hs
parent02d0ca7ebc56dd51b344e7bae791ffbf9864a2c1 (diff)
removed --keypairs and --wallets from *-public commands.
Diffstat (limited to 'kiki.hs')
-rw-r--r--kiki.hs139
1 files 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)
459 459
460 460
461 461
462kiki_usage cmd = putStr $ 462kiki_usage bSecret cmd = putStr $
463 case cmd of 463 case cmd of
464 "sync-secret" -> unlines 464 "sync-secret" -> unlines
465 ["kiki sync-secret [options...]" 465 ["kiki sync-secret [options...]"
@@ -520,33 +520,36 @@ kiki_usage cmd = putStr $
520 ," Provide keyring files other than the implicit secring.gpg and" 520 ," Provide keyring files other than the implicit secring.gpg and"
521 ," pubring.gpg in the --homedir. This option is implicit unless" 521 ," pubring.gpg in the --homedir. This option is implicit unless"
522 ," --keypairs or --wallets is used." 522 ," --keypairs or --wallets is used."
523 ,"" 523 ,""]
524 ," --wallets FILE FILE..." 524 ++ do
525 ," Provide wallet files with secret crypto-coin keys in Wallet" 525 guard bSecret
526 ," Import Format. The keys will be treated as subkeys of your" 526 unlines
527 ," current working key (the one shown by --show-wk)." 527 [" --wallets FILE FILE..."
528 ,"" 528 ," Provide wallet files with secret crypto-coin keys in Wallet"
529 ," --keypairs KEYSPEC KEYSPEC..." 529 ," Import Format. The keys will be treated as subkeys of your"
530 ," A keypair is a secret key coupled with it's corresponding public" 530 ," current working key (the one shown by --show-wk)."
531 ," key, both of which are ordinarily stored in a single file in pem" 531 ,""
532 ," format. Users incognisant of the fact that the public key (which" 532 ," --keypairs KEYSPEC KEYSPEC..."
533 ," is also stored separately) is in this file, often think of it as" 533 ," A keypair is a secret key coupled with it's corresponding public"
534 ," their secret key file." 534 ," key, both of which are ordinarily stored in a single file in pem"
535 ,"" 535 ," format. Users incognisant of the fact that the public key (which"
536 ," Each KEYSPEC specifies that a key should match the content and" 536 ," is also stored separately) is in this file, often think of it as"
537 ," timestamp of an external PKCS #1 private RSA key file." 537 ," their secret key file."
538 ," " 538 ,""
539 ," KEYSPEC ::= SPEC=FILE{CMD} " 539 ," Each KEYSPEC specifies that a key should match the content and"
540 ,"" 540 ," timestamp of an external PKCS #1 private RSA key file."
541 ," The form of SPEC is documented below. If there is only one master" 541 ," "
542 ," key in your keyring and only one key is used for each purpose, then" 542 ," KEYSPEC ::= SPEC=FILE{CMD} "
543 ," it is possible for SPEC in this case to merely be a tag which offers" 543 ,""
544 ," information about what this key is used for, for example, any of" 544 ," The form of SPEC is documented below. If there is only one master"
545 ," `tor', `ssh-client', `ssh-host', or `strongswan' will do." 545 ," key in your keyring and only one key is used for each purpose, then"
546 ,"" 546 ," it is possible for SPEC in this case to merely be a tag which offers"
547 ," If neither SPEC or FILE match any keys, then the CMD will be " 547 ," information about what this key is used for, for example, any of"
548 ," executed in order to create the FILE." 548 ," `tor', `ssh-client', `ssh-host', or `strongswan' will do."
549 ,"" 549 ,""
550 ," If neither SPEC or FILE match any keys, then the CMD will be "
551 ," executed in order to create the FILE."
552 ,""]
550{- ,"Output:" 553{- ,"Output:"
551 ," --show-wk Show fingerprints for the working key (which will be used to" 554 ," --show-wk Show fingerprints for the working key (which will be used to"
552 ," make signatures) and all its subkeys and UID." 555 ," make signatures) and all its subkeys and UID."
@@ -573,41 +576,43 @@ kiki_usage cmd = putStr $
573 ," --help Shows this help screen." 576 ," --help Shows this help screen."
574 ,"" 577 ,""
575 -} 578 -}
576 ,"Specifying keys on the kiki command line:" 579 ++
577 ,"" 580 unlines
578 ," SPEC ::= MASTER/SUBKEY" 581 ["Specifying keys on the kiki command line:"
579 ,"" 582 ,""
580 ," SPEC indicates a specific key in the keyring, in it's longest incarnation," 583 ," SPEC ::= MASTER/SUBKEY"
581 ," it is of the form MASTER/SUBKEY where MASTER and SUBKEY are documented below." 584 ,""
582 ," If kiki can infer the key unambiguously, either via the command in question or" 585 ," SPEC indicates a specific key in the keyring, in it's longest incarnation,"
583 ," the contents of the keyring, then it is permissable to ommit either MASTER or" 586 ," it is of the form MASTER/SUBKEY where MASTER and SUBKEY are documented below."
584 ," SUBKEY, in which case the slash may also be ommitted unless it is used via its" 587 ," If kiki can infer the key unambiguously, either via the command in question or"
585 ," position to indicate whether a SUBKEY or MASTER is intended." 588 ," the contents of the keyring, then it is permissable to ommit either MASTER or"
586 ,"" 589 ," SUBKEY, in which case the slash may also be ommitted unless it is used via its"
587 ," MASTER may be any of" 590 ," position to indicate whether a SUBKEY or MASTER is intended."
588 ," * The tail end of a fingerprint prefixed by 'fp:'" 591 ,""
589 ," * A sub-string of a user id (without slashes) prefixed by 'u:'" 592 ," MASTER may be any of"
590 ," * 40 characters of hexidecimal (kiki will assume this to be a fingerprint)" 593 ," * The tail end of a fingerprint prefixed by 'fp:'"
591 ," * A sub-string of a user id (without slashes, the prefix 'u:' is optional)" 594 ," * A sub-string of a user id (without slashes) prefixed by 'u:'"
592 ,"" 595 ," * 40 characters of hexidecimal (kiki will assume this to be a fingerprint)"
593 ," SUBKEY may be any of" 596 ," * A sub-string of a user id (without slashes, the prefix 'u:' is optional)"
594 ," * The tail end of a fingerprint prefixed by 'fp:'" 597 ,""
595 ," * An exact match of a usage tag prefixed by 't:'" 598 ," SUBKEY may be any of"
596 ," * 40 characters of hexidecimal (kiki will assume this to be a fingerprint)" 599 ," * The tail end of a fingerprint prefixed by 'fp:'"
597 ," * An exact match of a usage tag (The prefix 't:' is optional)" 600 ," * An exact match of a usage tag prefixed by 't:'"
598 ,"" 601 ," * 40 characters of hexidecimal (kiki will assume this to be a fingerprint)"
599 ," In parsing the spec, kiki will attempt to match the string to one of the" 602 ," * An exact match of a usage tag (The prefix 't:' is optional)"
600 ," above formats, in the order presented." 603 ,""
601 ,"" 604 ," In parsing the spec, kiki will attempt to match the string to one of the"
602 ," Examples of valid SPEC strings:" 605 ," above formats, in the order presented."
603 ,"" 606 ,""
604 ," fp:4A39F/tor" 607 ," Examples of valid SPEC strings:"
605 ," u:joe/tor" 608 ,""
606 ," u:joe/t:tor" 609 ," fp:4A39F/tor"
607 ," u:joe/fp:4abf30" 610 ," u:joe/tor"
608 ," joe/tor" 611 ," u:joe/t:tor"
609 ," 5E24CD442AA6965D2012E62A905C24185D5379C2" 612 ," u:joe/fp:4abf30"
610 ] 613 ," joe/tor"
614 ," 5E24CD442AA6965D2012E62A905C24185D5379C2"
615 ]
611 616
612doAutosign rt kd@(KeyData k ksigs umap submap) = ops 617doAutosign rt kd@(KeyData k ksigs umap submap) = ops
613 where 618 where
@@ -703,9 +708,9 @@ sync bExport bImport bSecret cmdarg args_raw = do
703 , ("--help",0) 708 , ("--help",0)
704 ] 709 ]
705 polyVariadicArgs = ["--keyrings" 710 polyVariadicArgs = ["--keyrings"
706 ,"--keypairs" 711 ,"--hosts" ]
707 ,"--wallets" 712 ++ do guard bSecret
708 ,"--hosts"] 713 [ "--keypairs", "--wallets" ]
709 -- putStrLn $ "margs = " ++ show (Map.assocs margs) 714 -- putStrLn $ "margs = " ++ show (Map.assocs margs)
710 unkeysRef <- newIORef Map.empty 715 unkeysRef <- newIORef Map.empty
711 pwRef <- newIORef Nothing 716 pwRef <- newIORef Nothing
@@ -763,7 +768,7 @@ sync bExport bImport bSecret cmdarg args_raw = do
763 , homeSpec = homespec 768 , homeSpec = homespec
764 } 769 }
765 770
766 (\f -> maybe f (const $ kiki_usage cmdarg) $ Map.lookup "--help" margs) $ do 771 (\f -> maybe f (const $ kiki_usage bSecret cmdarg) $ Map.lookup "--help" margs) $ do
767 KikiResult rt report <- runKeyRing kikiOp 772 KikiResult rt report <- runKeyRing kikiOp
768 773
769 case rt of 774 case rt of