diff options
Diffstat (limited to 'doc/examples/self_sig.cpp')
-rw-r--r-- | doc/examples/self_sig.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/doc/examples/self_sig.cpp b/doc/examples/self_sig.cpp index 42a58b485..a4b0c928c 100644 --- a/doc/examples/self_sig.cpp +++ b/doc/examples/self_sig.cpp @@ -42,13 +42,12 @@ int main(int argc, char* argv[]) try { - std::auto_ptr<RandomNumberGenerator> rng( - RandomNumberGenerator::make_rng()); + AutoSeeded_RNG rng; - RSA_PrivateKey key(*rng, 1024); + RSA_PrivateKey key(rng, 1024); std::ofstream priv_key("private.pem"); - priv_key << PKCS8::PEM_encode(key, *rng, argv[1]); + priv_key << PKCS8::PEM_encode(key, rng, argv[1]); X509_Cert_Options opts; @@ -63,7 +62,7 @@ int main(int argc, char* argv[]) if(do_CA) opts.CA_key(); - X509_Certificate cert = X509::create_self_signed_cert(opts, key, *rng); + X509_Certificate cert = X509::create_self_signed_cert(opts, key, rng); std::ofstream cert_file("cert.pem"); cert_file << cert.PEM_encode(); |