diff options
author | lloyd <[email protected]> | 2008-06-27 20:07:47 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-06-27 20:07:47 +0000 |
commit | 964dbc067992211e7d566c881de2c7330f46bef2 (patch) | |
tree | 9f4f5fdd444f3ded57238c92a03a2737deb19f24 /doc/examples/pkcs10.cpp | |
parent | cbcebfaad9ab6dc22186e93d259c6beed7fcff88 (diff) |
Update pkcs10, passhash examples
Diffstat (limited to 'doc/examples/pkcs10.cpp')
-rw-r--r-- | doc/examples/pkcs10.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/examples/pkcs10.cpp b/doc/examples/pkcs10.cpp index ae8230186..fd3ea0e1d 100644 --- a/doc/examples/pkcs10.cpp +++ b/doc/examples/pkcs10.cpp @@ -11,7 +11,6 @@ This file is in the public domain #include <botan/x509self.h> #include <botan/rsa.h> #include <botan/dsa.h> -#include <botan/libstate.h> using namespace Botan; #include <iostream> @@ -29,13 +28,14 @@ int main(int argc, char* argv[]) try { - RSA_PrivateKey priv_key(1024, global_state().prng_reference()); + std::auto_ptr<RandomNumberGenerator> rng(make_rng()); + RSA_PrivateKey priv_key(*rng, 1024); // If you want a DSA key instead of RSA, comment out the above line and // uncomment this one: //DSA_PrivateKey priv_key(DL_Group("dsa/jce/1024")); std::ofstream key_file("private.pem"); - key_file << PKCS8::PEM_encode(priv_key, argv[1]); + key_file << PKCS8::PEM_encode(priv_key, *rng, argv[1]); X509_Cert_Options opts; @@ -55,7 +55,7 @@ int main(int argc, char* argv[]) opts.xmpp = "[email protected]"; - PKCS10_Request req = X509::create_cert_req(opts, priv_key); + PKCS10_Request req = X509::create_cert_req(opts, priv_key, *rng); std::ofstream req_file("req.pem"); req_file << req.PEM_encode(); |