diff --git a/doc/tools/pkcs11-tool.1.xml b/doc/tools/pkcs11-tool.1.xml index f92cf5edfd8..576999daaca 100644 --- a/doc/tools/pkcs11-tool.1.xml +++ b/doc/tools/pkcs11-tool.1.xml @@ -148,7 +148,7 @@ Specify the type and length (bytes if symmetric) of the key to create, for example RSA:1024, EC:prime256v1, GOSTR3410-2012-256:B, - DES:8, DES3:24, AES:16 or GENERIC:64. + DES:8, DES3:24, AES:16 or GENERIC:64. If the key type was incompletely specified, possible values are listed. diff --git a/src/tools/pkcs11-tool.c b/src/tools/pkcs11-tool.c index bf7963f0285..8478f415aaf 100644 --- a/src/tools/pkcs11-tool.c +++ b/src/tools/pkcs11-tool.c @@ -2918,8 +2918,13 @@ static int gen_keypair(CK_SLOT_ID slot, CK_SESSION_HANDLE session, if (!strcmp(ec_curve_infos[ii].oid, type + 3)) break; } - if (!ec_curve_infos[ii].name) - util_fatal("Unknown EC key params '%s'", type + 3); + if (!ec_curve_infos[ii].name) { + fprintf(stderr, "EC key parameters may be specified by their canonic name or object identifier. Possible values are:\n"); + for (ii=0; ec_curve_infos[ii].name; ii++) { + fprintf(stderr, "%s (%s)\n", ec_curve_infos[ii].name, ec_curve_infos[ii].oid); + } + util_fatal("Unknown EC key parameter '%s'", type + 3); + } switch (ec_curve_infos[ii].mechanism) { case CKM_EC_EDWARDS_KEY_PAIR_GEN: