4 /*****************************************************************************\
6 * Name : SSL initialization helper *
7 * Author : Chris Koeritz *
9 *******************************************************************************
10 * Copyright (c) 2005-$now By Author. This program is free software; you can *
11 * redistribute it and/or modify it under the terms of the GNU General Public *
12 * License as published by the Free Software Foundation; either version 2 of *
13 * the License or (at your option) any later version. This is online at: *
14 * http://www.fsf.org/copyleft/gpl.html *
15 * Please send any updates to: fred@gruntose.com *
16 \*****************************************************************************/
18 #include <basis/byte_array.h>
19 #include <mathematics/chaos.h>
23 //! provides some initialization for the RSA and blowfish crypto.
25 This class does the SSL initialization needed before any functions can
26 be used. It also sets up the random seed for SSL. NOTE: you should never
27 need to use this class directly; just use the accessor function at the
28 very bottom and it will be managed globally for the entire program.
31 //we define NEWER_OPENSSL for those places where we're using openssl 1.1.1.
35 // #define OLDER_OPENSSL
38 class ssl_init : public virtual basis::nameable
44 DEFINE_CLASS_NAME("ssl_init");
46 basis::byte_array random_bytes(int length) const;
47 //!< can be used to generate a random array of "length" bytes.
49 const mathematics::chaos &randomizer() const;
50 //!< provides a random number generator for any encryption routines.
53 mathematics::chaos c_rando; //!< used for generating random numbers.
56 extern const ssl_init &static_ssl_initializer();
57 //!< the main method for accessing the SSL initialization support.