aboutsummaryrefslogtreecommitdiffstats
path: root/src/pki/commands/req.c
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2016-08-31 17:57:12 +0200
committerTobias Brunner <tobias@strongswan.org>2016-10-05 11:32:52 +0200
commit05ccde0a8bd9d669fa186aa4d4a3d37d2a8155c1 (patch)
treeda1e72e8d744aaefe34d03b26b3f5859c3686f51 /src/pki/commands/req.c
parent4a6f97d00bb5ed022ec8e06360e4cdc53ea536f6 (diff)
downloadstrongswan-05ccde0a8bd9.tar.bz2
strongswan-05ccde0a8bd9.tar.xz
pki: Add generic 'priv' key type that loads any type of private key
Diffstat (limited to 'src/pki/commands/req.c')
-rw-r--r--src/pki/commands/req.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/pki/commands/req.c b/src/pki/commands/req.c
index 68d611250..23d07a28d 100644
--- a/src/pki/commands/req.c
+++ b/src/pki/commands/req.c
@@ -30,7 +30,7 @@
static int req()
{
cred_encoding_type_t form = CERT_ASN1_DER;
- key_type_t type = KEY_RSA;
+ key_type_t type = KEY_ANY;
hash_algorithm_t digest = HASH_UNKNOWN;
certificate_t *cert = NULL;
private_key_t *private = NULL;
@@ -62,6 +62,10 @@ static int req()
{
type = KEY_BLISS;
}
+ else if (streq(arg, "priv"))
+ {
+ type = KEY_ANY;
+ }
else
{
error = "invalid input type";
@@ -194,14 +198,14 @@ static void __attribute__ ((constructor))reg()
command_register((command_t) {
req, 'r', "req",
"create a PKCS#10 certificate request",
- {" [--in file] [--type rsa|ecdsa|bliss] --dn distinguished-name",
+ {" [--in file] [--type rsa|ecdsa|bliss|priv] --dn distinguished-name",
"[--san subjectAltName]+ [--password challengePassword]",
"[--digest md5|sha1|sha224|sha256|sha384|sha512|sha3_224|sha3_256|sha3_384|sha3_512]",
"[--outform der|pem]"},
{
{"help", 'h', 0, "show usage information"},
{"in", 'i', 1, "private key input file, default: stdin"},
- {"type", 't', 1, "type of input key, default: rsa"},
+ {"type", 't', 1, "type of input key, default: priv"},
{"dn", 'd', 1, "subject distinguished name"},
{"san", 'a', 1, "subjectAltName to include in cert request"},
{"password",'p', 1, "challengePassword to include in cert request"},