diff options
author | Werner Koch <[email protected]> | 2009-07-07 14:33:10 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2009-07-07 14:33:10 +0000 |
commit | b996b0540a0d78f3a3580da7814f0d86264da511 (patch) | |
tree | 92a30f74200b6e816113262c57da188a44624d10 /tests/run-keylist.c | |
parent | Move gpg test programs to the top test directory. (diff) | |
download | gpgme-b996b0540a0d78f3a3580da7814f0d86264da511.tar.gz gpgme-b996b0540a0d78f3a3580da7814f0d86264da511.zip |
Inmplement import from keys for GPGSM.
Add option --cms to run-keylist test program.
Diffstat (limited to 'tests/run-keylist.c')
-rw-r--r-- | tests/run-keylist.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/run-keylist.c b/tests/run-keylist.c index 07fc8941..8dd28b8f 100644 --- a/tests/run-keylist.c +++ b/tests/run-keylist.c @@ -43,6 +43,8 @@ show_usage (int ex) fputs ("usage: " PGM " [options] [USERID]\n\n" "Options:\n" " --verbose run in verbose mode\n" + " --openpgp use the OpenPGP protocol (default)\n" + " --cms use the CMS protocol\n" " --local use GPGME_KEYLIST_MODE_LOCAL\n" " --extern use GPGME_KEYLIST_MODE_EXTERN\n" " --sigs use GPGME_KEYLIST_MODE_SIGS\n" @@ -54,6 +56,7 @@ show_usage (int ex) exit (ex); } + int main (int argc, char **argv) { @@ -66,6 +69,7 @@ main (int argc, char **argv) int import = 0; gpgme_key_t keyarray[100]; int keyidx = 0; + gpgme_protocol_t protocol = GPGME_PROTOCOL_OpenPGP; if (argc) { argc--; argv++; } @@ -85,6 +89,16 @@ main (int argc, char **argv) verbose = 1; argc--; argv++; } + else if (!strcmp (*argv, "--openpgp")) + { + protocol = GPGME_PROTOCOL_OpenPGP; + argc--; argv++; + } + else if (!strcmp (*argv, "--cms")) + { + protocol = GPGME_PROTOCOL_CMS; + argc--; argv++; + } else if (!strcmp (*argv, "--local")) { mode |= GPGME_KEYLIST_MODE_LOCAL; @@ -128,11 +142,11 @@ main (int argc, char **argv) if (argc > 1) show_usage (1); - init_gpgme (GPGME_PROTOCOL_OpenPGP); + init_gpgme (protocol); err = gpgme_new (&ctx); fail_if_err (err); - gpgme_set_protocol (ctx, GPGME_PROTOCOL_OpenPGP); + gpgme_set_protocol (ctx, protocol); gpgme_set_keylist_mode (ctx, mode); |