diff options
author | lloyd <[email protected]> | 2008-06-27 19:29:19 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-06-27 19:29:19 +0000 |
commit | cbcebfaad9ab6dc22186e93d259c6beed7fcff88 (patch) | |
tree | 73540a68f94fc397289c034f0babb0c645cecacc /doc/examples/rsa_kgen.cpp | |
parent | e2a465b75d8baeac912e3f4d428ebc5e03fd76f1 (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.cpp | 7 |
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) { |