aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/rsa_kgen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'doc/examples/rsa_kgen.cpp')
-rw-r--r--doc/examples/rsa_kgen.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/examples/rsa_kgen.cpp b/doc/examples/rsa_kgen.cpp
index e57f60c06..de2ed0db7 100644
--- a/doc/examples/rsa_kgen.cpp
+++ b/doc/examples/rsa_kgen.cpp
@@ -14,6 +14,7 @@ This file is in the public domain
#include <string>
#include <botan/botan.h>
#include <botan/rsa.h>
+#include <botan/libstate.h>
using namespace Botan;
int main(int argc, char* argv[])
@@ -26,7 +27,7 @@ int main(int argc, char* argv[])
}
u32bit bits = std::atoi(argv[1]);
- if(bits < 512 || bits > 4096)
+ if(bits < 1024 || bits > 4096)
{
std::cout << "Invalid argument for bitsize" << std::endl;
return 1;
@@ -42,7 +43,7 @@ int main(int argc, char* argv[])
try
{
- RSA_PrivateKey key(bits);
+ RSA_PrivateKey key(bits, global_state().prng_reference());
pub << X509::PEM_encode(key);
if(argc == 2)