diff options
author | Andreas Steffen <andreas@strongswan.org> | 2009-09-15 06:23:38 +0200 |
---|---|---|
committer | Andreas Steffen <andreas@strongswan.org> | 2009-09-15 06:24:14 +0200 |
commit | 622e558cb0d6e9eb7ee8d48a6166ae1da5e77db6 (patch) | |
tree | cf41a0a7582eb88e2b2a965b201bde43e7107b27 /src | |
parent | 0912f0d2bc5fd40f4a0e9d94932ee1ce88b18bee (diff) | |
download | strongswan-622e558cb0d6e9eb7ee8d48a6166ae1da5e77db6.tar.bz2 strongswan-622e558cb0d6e9eb7ee8d48a6166ae1da5e77db6.tar.xz |
pki --pub and --keyid accept pkcs10 as input
Diffstat (limited to 'src')
-rw-r--r-- | src/pki/commands/keyid.c | 8 | ||||
-rw-r--r-- | src/pki/commands/pub.c | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/pki/commands/keyid.c b/src/pki/commands/keyid.c index 49cc1cc58..b302a8fcb 100644 --- a/src/pki/commands/keyid.c +++ b/src/pki/commands/keyid.c @@ -57,6 +57,11 @@ static int keyid(int argc, char *argv[]) type = CRED_PUBLIC_KEY; subtype = KEY_ANY; } + else if (streq(optarg, "pkcs10")) + { + type = CRED_CERTIFICATE; + subtype = CERT_PKCS10_REQUEST; + } else if (streq(optarg, "x509")) { type = CRED_CERTIFICATE; @@ -150,7 +155,8 @@ static void __attribute__ ((constructor))reg() command_register((command_t) { keyid, 'k', "keyid", "calculate key identifiers of a key/certificate", - {"[--in file] [--type rsa-priv|ecdsa-priv|pub|x509]"}, + {"[--in file] [--type rsa-priv|ecdsa-priv|pub|pkcs10|x509]", + "[--debug 0|1|2|3|4]"}, { {"help", 'h', 0, "show usage information"}, {"in", 'i', 1, "input file, default: stdin"}, diff --git a/src/pki/commands/pub.c b/src/pki/commands/pub.c index 9e4897b2a..05430675d 100644 --- a/src/pki/commands/pub.c +++ b/src/pki/commands/pub.c @@ -53,6 +53,11 @@ static int pub(int argc, char *argv[]) type = CRED_PRIVATE_KEY; subtype = KEY_ECDSA; } + else if (streq(optarg, "pkcs10")) + { + type = CRED_CERTIFICATE; + subtype = CERT_PKCS10_REQUEST; + } else if (streq(optarg, "x509")) { type = CRED_CERTIFICATE; @@ -142,7 +147,8 @@ static void __attribute__ ((constructor))reg() command_register((command_t) { pub, 'p', "pub", "extract the public key from a private key/certificate", - {"[--in file] [--type rsa|ecdsa|x509] [--outform der|pem|pgp]"}, + {"[--in file] [--type rsa|ecdsa|pkcs10|x509] [--outform der|pem|pgp]", + "[--debug 0|1|2|3|4]"}, { {"help", 'h', 0, "show usage information"}, {"in", 'i', 1, "input file, default: stdin"}, |