diff options
author | Simon Warta <[email protected]> | 2015-12-08 19:56:19 +0100 |
---|---|---|
committer | Simon Warta <[email protected]> | 2015-12-08 22:02:28 +0100 |
commit | 368d087e3973db9d8c5b70443d31c27c03dfdbef (patch) | |
tree | 9059a52c70eee8b825d9fd7fa14194940853b86a /src/cmd/pkcs10.cpp | |
parent | 53fca25da331d168b0433ba2e41b06aae9d17f5c (diff) |
Replace C interfaces in cli apps with C++ interfaces
Diffstat (limited to 'src/cmd/pkcs10.cpp')
-rw-r--r-- | src/cmd/pkcs10.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/cmd/pkcs10.cpp b/src/cmd/pkcs10.cpp index 18fdea9bf..106fe2c24 100644 --- a/src/cmd/pkcs10.cpp +++ b/src/cmd/pkcs10.cpp @@ -18,11 +18,11 @@ using namespace Botan; namespace { -int pkcs10(int argc, char* argv[]) +int pkcs10(const std::vector<std::string> &args) { - if(argc != 6) + if(args.size() != 6) { - std::cout << "Usage: " << argv[0] + std::cout << "Usage: " << args[0] << " passphrase name country_code organization email" << std::endl; return 1; } @@ -34,14 +34,14 @@ int pkcs10(int argc, char* argv[]) RSA_PrivateKey priv_key(rng, 1024); std::ofstream key_file("private.pem"); - key_file << PKCS8::PEM_encode(priv_key, rng, argv[1]); + key_file << PKCS8::PEM_encode(priv_key, rng, args[1]); X509_Cert_Options opts; - opts.common_name = argv[2]; - opts.country = argv[3]; - opts.organization = argv[4]; - opts.email = argv[5]; + opts.common_name = args[2]; + opts.country = args[3]; + opts.organization = args[4]; + opts.email = args[5]; PKCS10_Request req = X509::create_cert_req(opts, priv_key, "SHA-256", rng); |