aboutsummaryrefslogtreecommitdiffstats
path: root/src/cli/x509.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-06-28 16:50:10 -0400
committerJack Lloyd <[email protected]>2018-06-28 16:50:10 -0400
commit61273b884af9ee23d034aeef939ad69326205307 (patch)
tree3514a86bfb6d280a0d6f389685c89b03e3232081 /src/cli/x509.cpp
parent358d288f7538f00e6b421a2cfb47655d7ed31f28 (diff)
Allow setting extended key usage when generating PKCS10
Diffstat (limited to 'src/cli/x509.cpp')
-rw-r--r--src/cli/x509.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cli/x509.cpp b/src/cli/x509.cpp
index ca21c1493..adae8285c 100644
--- a/src/cli/x509.cpp
+++ b/src/cli/x509.cpp
@@ -298,7 +298,7 @@ class Generate_PKCS10 final : public Command
public:
Generate_PKCS10()
: Command("gen_pkcs10 key CN --country= --organization= "
- "--email= --dns= --key-pass= --hash=SHA-256 --emsa=") {}
+ "--email= --dns= --ext-ku= --key-pass= --hash=SHA-256 --emsa=") {}
std::string group() const override
{
@@ -327,6 +327,11 @@ class Generate_PKCS10 final : public Command
opts.email = get_arg("email");
opts.more_dns = Botan::split_on(get_arg("dns"), ',');
+ for(std::string ext_ku : Botan::split_on(get_arg("ext-ku"), ','))
+ {
+ opts.add_ex_constraint(ext_ku);
+ }
+
std::string emsa = get_arg("emsa");
if(emsa.empty() == false)