diff options
author | lloyd <[email protected]> | 2011-04-08 18:13:41 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2011-04-08 18:13:41 +0000 |
commit | 8b543e804375a788ae71d461c0f8cf5d4193fc25 (patch) | |
tree | 6177931cd84a9be204cdab6e62729954e69e0421 /doc/examples/self_sig.cpp | |
parent | 3b66bfd4da97189ec275e5f85b9f85009d3f8370 (diff) |
ECC private keys had two different constructors, one taking a group
and a random number generator, and the other taking a group and a
preset private key value. The DL private keys instead have on
constructor for this; if the x value is zero, then a new random key is
created. For consistency, do this with ECC as well.
ECDH actually didn't have one of these constructors, forcing you to
either load from PKCS #8 or else use a random key.
Rename EC_Domain_Params to EC_Group, with a typedef for compatability.
More doc updates.
Update mtn ignores for Sphinx output
Diffstat (limited to 'doc/examples/self_sig.cpp')
-rw-r--r-- | doc/examples/self_sig.cpp | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/doc/examples/self_sig.cpp b/doc/examples/self_sig.cpp index 6710cfb51..64b778b71 100644 --- a/doc/examples/self_sig.cpp +++ b/doc/examples/self_sig.cpp @@ -1,17 +1,3 @@ -/* -* (C) 2003 Jack Lloyd -* -* Distributed under the terms of the Botan license -*/ - -/* -Generate a 1024 bit RSA key, and then create a self-signed X.509v3 -certificate with that key. If the do_CA variable is set to true, then -it will be marked for CA use, otherwise it will get extensions -appropriate for use with a client certificate. The private key is -stored as an encrypted PKCS #8 object in another file. -*/ - #include <botan/botan.h> #include <botan/x509self.h> #include <botan/rsa.h> @@ -49,7 +35,7 @@ int main(int argc, char* argv[]) { AutoSeeded_RNG rng; - RSA_PrivateKey key(rng, 1024); + RSA_PrivateKey key(rng, 2048); std::ofstream priv_key("private.pem"); priv_key << PKCS8::PEM_encode(key, rng, argv[1]); |