aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/rsa_kgen.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-06-27 19:29:19 +0000
committerlloyd <[email protected]>2008-06-27 19:29:19 +0000
commitcbcebfaad9ab6dc22186e93d259c6beed7fcff88 (patch)
tree73540a68f94fc397289c034f0babb0c645cecacc /doc/examples/rsa_kgen.cpp
parente2a465b75d8baeac912e3f4d428ebc5e03fd76f1 (diff)
Update some of the examples for the recent API changes
Diffstat (limited to 'doc/examples/rsa_kgen.cpp')
-rw-r--r--doc/examples/rsa_kgen.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/doc/examples/rsa_kgen.cpp b/doc/examples/rsa_kgen.cpp
index 13d602d66..7230e7a4a 100644
--- a/doc/examples/rsa_kgen.cpp
+++ b/doc/examples/rsa_kgen.cpp
@@ -13,10 +13,10 @@ This file is in the public domain
#include <fstream>
#include <string>
#include <cstdlib>
+#include <memory>
#include <botan/botan.h>
#include <botan/rsa.h>
-#include <botan/libstate.h>
using namespace Botan;
int main(int argc, char* argv[])
@@ -45,13 +45,14 @@ int main(int argc, char* argv[])
try
{
- RSA_PrivateKey key(bits, global_state().prng_reference());
+ std::auto_ptr<RandomNumberGenerator> rng(make_rng());
+ RSA_PrivateKey key(*rng, bits);
pub << X509::PEM_encode(key);
if(argc == 2)
priv << PKCS8::PEM_encode(key);
else
- priv << PKCS8::PEM_encode(key, argv[2]);
+ priv << PKCS8::PEM_encode(key, *rng, argv[2]);
}
catch(std::exception& e)
{