aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/self_sig.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-05-24 18:47:11 +0000
committerlloyd <[email protected]>2008-05-24 18:47:11 +0000
commitc4bad5476b30811ad51b1edd3bd873864d423c07 (patch)
tree94679d6cee3a38da1d64b8f5f671986566ac8a18 /doc/examples/self_sig.cpp
parentebc67ae27481549a152858f24fff4a7a82ad4e51 (diff)
Avoid using the global RNG in check_key, instead pass a reference.
Update the examples
Diffstat (limited to 'doc/examples/self_sig.cpp')
-rw-r--r--doc/examples/self_sig.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/doc/examples/self_sig.cpp b/doc/examples/self_sig.cpp
index d00bcb3b4..c2118be40 100644
--- a/doc/examples/self_sig.cpp
+++ b/doc/examples/self_sig.cpp
@@ -13,6 +13,7 @@ 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>
@@ -39,9 +40,9 @@ int main(int argc, char* argv[])
return 1;
}
- try {
- RSA_PrivateKey key(1024);
- //DSA_PrivateKey key(DL_Group("dsa/jce/1024"));
+ try
+ {
+ RSA_PrivateKey key(1024, global_state().prng_reference());
std::ofstream priv_key("private.pem");
priv_key << PKCS8::PEM_encode(key, argv[1]);