aboutsummaryrefslogtreecommitdiffstats
path: root/g10/gpg.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2014-09-27 13:14:13 +0000
committerWerner Koch <[email protected]>2014-09-27 13:14:13 +0000
commitf3625bb018fa8d5bc754f982996f8788386f0a9d (patch)
tree113515152d04891d29180ef1ecab459b27a2a1c1 /g10/gpg.c
parentdoc: Update the file OpenPGP (diff)
downloadgnupg-f3625bb018fa8d5bc754f982996f8788386f0a9d.tar.gz
gnupg-f3625bb018fa8d5bc754f982996f8788386f0a9d.zip
gpg: Simplify command --gen-key and add --full-gen-key.
* g10/gpg.c (aFullKeygen): New. (opts): Add command --full-key-gen. (main): Implement it. * g10/keygen.c (DEFAULT_STD_ALGO): Replace wrong GCRY_PK_RSA although the value is identical. (DEFAULT_STD_CURVE): New. (DEFAULT_STD_SUBALGO): New. (DEFAULT_STD_SUBKEYSIZE): New. (DEFAULT_STD_SUBCURVE): New. (quick_generate_keypair): Use new macros here. (generate_keypair): Add arg "full" and fix call callers. Do not ask for keysize in non-full node. (ask_user_id): Add arg "full" and simplify for non-full mode.
Diffstat (limited to '')
-rw-r--r--g10/gpg.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/g10/gpg.c b/g10/gpg.c
index 95a78d505..f5860428a 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -107,6 +107,7 @@ enum cmd_and_opt_values
aClearsign,
aStore,
aQuickKeygen,
+ aFullKeygen,
aKeygen,
aSignEncr,
aSignEncrSym,
@@ -407,9 +408,12 @@ static ARGPARSE_OPTS opts[] = {
ARGPARSE_c (aCheckKeys, "check-sigs",N_("list and check key signatures")),
ARGPARSE_c (oFingerprint, "fingerprint", N_("list keys and fingerprints")),
ARGPARSE_c (aListSecretKeys, "list-secret-keys", N_("list secret keys")),
- ARGPARSE_c (aQuickKeygen, "quick-gen-key" ,
+ ARGPARSE_c (aKeygen, "gen-key",
+ N_("generate a new key pair")),
+ ARGPARSE_c (aQuickKeygen, "quick-gen-key" ,
N_("quickly generate a new key pair")),
- ARGPARSE_c (aKeygen, "gen-key", N_("generate a new key pair")),
+ ARGPARSE_c (aFullKeygen, "full-gen-key" ,
+ N_("full featured key pair generation")),
ARGPARSE_c (aGenRevoke, "gen-revoke",N_("generate a revocation certificate")),
ARGPARSE_c (aDeleteKeys,"delete-keys",
N_("remove keys from the public keyring")),
@@ -2307,6 +2311,7 @@ main (int argc, char **argv)
break;
case aKeygen:
+ case aFullKeygen:
case aEditKey:
case aDeleteSecretKeys:
case aDeleteSecretAndPublicKeys:
@@ -3564,6 +3569,7 @@ main (int argc, char **argv)
case aDeleteSecretKeys:
case aDeleteSecretAndPublicKeys:
case aQuickKeygen:
+ case aFullKeygen:
case aKeygen:
case aImport:
case aExportSecret:
@@ -3859,12 +3865,27 @@ main (int argc, char **argv)
if( opt.batch ) {
if( argc > 1 )
wrong_args("--gen-key [parameterfile]");
- generate_keypair (ctrl, argc? *argv : NULL, NULL, 0);
+ generate_keypair (ctrl, 0, argc? *argv : NULL, NULL, 0);
}
else {
if( argc )
wrong_args("--gen-key");
- generate_keypair (ctrl, NULL, NULL, 0);
+ generate_keypair (ctrl, 0, NULL, NULL, 0);
+ }
+ break;
+
+ case aFullKeygen: /* Generate a key with all options. */
+ if (opt.batch)
+ {
+ if (argc > 1)
+ wrong_args ("--full-gen-key [parameterfile]");
+ generate_keypair (ctrl, 1, argc? *argv : NULL, NULL, 0);
+ }
+ else
+ {
+ if (argc)
+ wrong_args("--full-gen-key");
+ generate_keypair (ctrl, 1, NULL, NULL, 0);
}
break;