aboutsummaryrefslogtreecommitdiffstats
path: root/src/pki/commands/self.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/self.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/self.c')
-rw-r--r--src/pki/commands/self.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pki/commands/self.c b/src/pki/commands/self.c
index f4e83c76c..6fb7b75ae 100644
--- a/src/pki/commands/self.c
+++ b/src/pki/commands/self.c
@@ -94,6 +94,10 @@ static int self()
{
type = KEY_BLISS;
}
+ else if (streq(arg, "priv"))
+ {
+ type = KEY_ANY;
+ }
else
{
error = "invalid input type";
@@ -417,7 +421,7 @@ static void __attribute__ ((constructor))reg()
command_register((command_t) {
self, 's', "self",
"create a self signed certificate",
- {" [--in file|--keyid hex] [--type rsa|ecdsa|bliss]",
+ {" [--in file|--keyid hex] [--type rsa|ecdsa|bliss|priv]",
" --dn distinguished-name [--san subjectAltName]+",
"[--lifetime days] [--serial hex] [--ca] [--ocsp uri]+",
"[--flag serverAuth|clientAuth|crlSign|ocspSigning|msSmartcardLogon]+",
@@ -431,7 +435,7 @@ static void __attribute__ ((constructor))reg()
{"help", 'h', 0, "show usage information"},
{"in", 'i', 1, "private key input file, default: stdin"},
{"keyid", 'x', 1, "keyid on smartcard of private key"},
- {"type", 't', 1, "type of input key, default: rsa"},
+ {"type", 't', 1, "type of input key, default: priv"},
{"dn", 'd', 1, "subject and issuer distinguished name"},
{"san", 'a', 1, "subjectAltName to include in certificate"},
{"lifetime", 'l', 1, "days the certificate is valid, default: 1095"},