Codebase list gpgme1.0 / 7addffc
tests: Add option --secret to run-keylist. Signed-off-by: Werner Koch <wk@gnupg.org> Werner Koch 8 years ago
1 changed file(s) with 8 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
4444 " --verbose run in verbose mode\n"
4545 " --openpgp use the OpenPGP protocol (default)\n"
4646 " --cms use the CMS protocol\n"
47 " --secret list only secret keys\n"
4748 " --local use GPGME_KEYLIST_MODE_LOCAL\n"
4849 " --extern use GPGME_KEYLIST_MODE_EXTERN\n"
4950 " --sigs use GPGME_KEYLIST_MODE_SIGS\n"
6970 gpgme_key_t keyarray[100];
7071 int keyidx = 0;
7172 gpgme_protocol_t protocol = GPGME_PROTOCOL_OpenPGP;
73 int only_secret = 0;
7274
7375 if (argc)
7476 { argc--; argv++; }
98100 protocol = GPGME_PROTOCOL_CMS;
99101 argc--; argv++;
100102 }
103 else if (!strcmp (*argv, "--secret"))
104 {
105 only_secret = 1;
106 argc--; argv++;
107 }
101108 else if (!strcmp (*argv, "--local"))
102109 {
103110 mode |= GPGME_KEYLIST_MODE_LOCAL;
149156
150157 gpgme_set_keylist_mode (ctx, mode);
151158
152 err = gpgme_op_keylist_start (ctx, argc? argv[0]:NULL, 0);
159 err = gpgme_op_keylist_start (ctx, argc? argv[0]:NULL, only_secret);
153160 fail_if_err (err);
154161
155162 while (!(err = gpgme_op_keylist_next (ctx, &key)))