gpgme/tests
Werner Koch 00c501d296
core: New function gpgme_op_create_key.
* src/engine-backend.h (engine_ops): Change prototype of genkey.
* src/engine-gpgsm.c (gpgsm_genkey): Change accordingly.
* src/engine-gpg.c (gpg_genkey): Change it to a dispatcher.
(gpg_createkey_from_param): New for the old functionality.
(gpg_createkey_legacy): New.  Stub for now.
(gpg_createkey): New.
(gpg_addkey): New.  Stub for now.
(gpg_adduid): New.  Stub for now.
* src/engine.c (_gpgme_engine_op_genkey): Add new args.
* src/genkey.c (op_data_t): Add field ERROR_CODE.
(parse_error): New.
(genkey_status_handler): Parse ERROR status line.
(genkey_start): Use NULL/0 for the new args.
(createkey_start): New.
(gpgme_op_createkey_start, gpgme_op_createkey): New.
* src/gpgme.def, src/libgpgme.vers: Add gpgme_op_createkey_start and
gpgme_op_createkey.
* src/gpgme.h.in (_gpgme_op_genkey_result): Add fields PUBKEY and
SECKEY.
(GPGME_CREATE_SIGN): New.
(GPGME_CREATE_ENCR): New.
(GPGME_CREATE_CERT): New.
(GPGME_CREATE_AUTH): New.
(GPGME_CREATE_NOPASSWD): New.
(GPGME_CREATE_SELFSIGNED): New.
(GPGME_CREATE_NOSTORE): New.
(GPGME_CREATE_WANTPUB): New.
(GPGME_CREATE_WANTSEC): New.
(GPGME_CREATE_FORCE): New.

* tests/run-genkey.c: New.
* tests/Makefile.am (noinst_PROGRAMS): Add it.
--

This function uses the new --quick-gen-key API of gpg.  A limited
compatibility mode to use older gpg versions and gpgsm will eventually
be provided.  Not all flags are currently implemented.

 ./run-genkey --unprotected --force test@example.com

Create a new standard key with the given user id.  --force is used to
allow creating more than one key with that user id in the keyring.

 ./run-genkey --unprotected --force \
      test@example.com default default 2145826800

Creates a new standard key with an expiration date of 2037-12-31.

 ./run-genkey --unprotected --force \
      test@example.com future-default default 2145826800

Create a standard key using the fugure default algorithms.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-13 18:59:10 +02:00
..
gpg tests: Fix version comparison. 2016-09-12 15:42:07 +02:00
gpgsm tests: Fix trivial memory leaks. 2016-06-27 18:14:02 +02:00
opassuan Switch to automake 1.14 and update build-aux files. 2015-01-30 10:45:20 +01:00
.gitignore .gitignore: flesh out rules and add subdirectory-.gitignores. 2012-04-20 16:05:11 +02:00
ChangeLog-2011 Generate the ChangeLog from commit logs. 2011-12-02 11:36:37 +01:00
Makefile.am core: New function gpgme_op_create_key. 2016-09-13 18:59:10 +02:00
run-decrypt.c tests: Add new test tool run-decrypt 2016-06-24 11:33:05 +02:00
run-encrypt.c core: Make use of the "size-hint" in engine-gpg. 2016-08-12 15:32:31 +02:00
run-export.c Add an export secret key feature. 2015-08-24 12:41:24 +02:00
run-genkey.c core: New function gpgme_op_create_key. 2016-09-13 18:59:10 +02:00
run-identify.c tests: Add new test tool run-identify. 2016-06-21 16:18:00 +02:00
run-import.c Remove all trailing whitespace from source files 2012-09-25 15:29:49 +02:00
run-keylist.c core,cpp: Extend the TOFU information. 2016-09-07 09:26:11 +02:00
run-sign.c tests: Allow using run-sign to test loopback pinentry problems. 2015-08-25 09:05:33 +02:00
run-support.h Remove all trailing whitespace from source files 2012-09-25 15:29:49 +02:00
run-verify.c core,cpp: Extend the TOFU information. 2016-09-07 09:26:11 +02:00
start-stop-agent Fix test suite for GnuPG 2.1 which uses pubring.kbx. 2015-06-08 10:43:29 +02:00
t-data-1.txt 2001-10-16 Marcus Brinkmann <marcus@g10code.de> 2001-10-17 19:17:46 +00:00
t-data-2.txt 2001-10-16 Marcus Brinkmann <marcus@g10code.de> 2001-10-17 19:17:46 +00:00
t-data.c tests: Fix trivial memory leaks. 2016-06-27 18:14:02 +02:00
t-engine-info.c core: Add new items for gpgme_get_dirinfo. 2016-08-22 16:57:51 +02:00
t-version.c Change the various version numbers to the new scheme. 2013-02-26 17:10:18 +01:00