aboutsummaryrefslogtreecommitdiffstats
path: root/include/init.h
blob: f4296a86884f3cdb9e9968280aa94141d659d899 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*************************************************
* Library Initialization Header File             *
* (C) 1999-2007 Jack Lloyd                       *
*************************************************/

#ifndef BOTAN_INIT_H__
#define BOTAN_INIT_H__

#include <botan/build.h>
#include <string>
#include <map>

namespace Botan {

/*************************************************
* Options for initializing the library           *
*************************************************/
class BOTAN_DLL InitializerOptions
   {
   public:
      bool thread_safe() const;
      bool use_engines() const;
      bool secure_memory() const;
      bool fips_mode() const;
      bool self_test() const;

      InitializerOptions(const std::string&);
   private:
      std::map<std::string, std::string> args;
   };

/*************************************************
* Library Initialization/Shutdown Object         *
*************************************************/
class BOTAN_DLL LibraryInitializer
   {
   public:
      static void initialize(const std::string& = "");
      static void initialize(const InitializerOptions&);
      static void initialize(const InitializerOptions&, class Modules&);
      static void deinitialize();

      LibraryInitializer(const std::string& args = "") { initialize(args); }
      LibraryInitializer(const InitializerOptions& args) { initialize(args); }
      ~LibraryInitializer() { deinitialize(); }
   };

}

#endif