libcryptosec
Engine.h
Go to the documentation of this file.
1 #ifndef ENGINE_H_
2 #define ENGINE_H_
3 
4 #include <openssl/engine.h>
5 #include <vector>
6 #include <string>
7 
9 
19 class Engine
20 {
21 public:
22 
27  enum Algorithm
28  {
29  RSA,
30  DSA,
31 // DH,
33 // ECDH,
37 // STORE,
38  ALL,
40  };
41 
46  enum CmdType
47  {
52  };
53 
59  Engine(ENGINE *engine);
60 
61 
67  Engine(const Engine &engine);
68 
69 
74  virtual ~Engine();
75 
81  std::string getId() throw (EngineException);
82 
87  bool testInit();
88 
93  std::vector<Engine::Algorithm> getCapabilities();
94 
100  void setCommand(std::string key) throw (EngineException);
101 
108  void setCommand(std::string key, std::string value) throw (EngineException);
109 
116  void setCommand(std::string key, long value) throw (EngineException);
117 
122  std::vector<std::pair<Engine::CmdType, std::string> > getAvaliableCmds();
123 
130  virtual void addToEnginesList() throw (EngineException);
131 
138  virtual void removeFromEnginesList() throw (EngineException);
139 
144  ENGINE* getEngine() const;
145 
150  static std::string algorithm2Name(Engine::Algorithm algorithm);
151 
152 protected:
153 
157  ENGINE *engine;
158 };
159 
160 #endif /*ENGINE_H_*/
static std::string algorithm2Name(Engine::Algorithm algorithm)
Definition: Engine.cpp:167
Definition: Engine.h:35
Definition: Engine.h:29
virtual void removeFromEnginesList()
Definition: Engine.cpp:158
Definition: Engine.h:49
Define as características funcionais de uma engine do OpenSSL.
Definition: Engine.h:19
Algorithm
Definition: Engine.h:27
bool testInit()
Definition: Engine.cpp:37
virtual void addToEnginesList()
Definition: Engine.cpp:154
virtual ~Engine()
Definition: Engine.cpp:14
Definition: Engine.h:32
std::string getId()
Definition: Engine.cpp:23
Definition: EngineException.h:6
void setCommand(std::string key)
Definition: Engine.cpp:97
std::vector< std::pair< Engine::CmdType, std::string > > getAvaliableCmds()
Definition: Engine.cpp:121
std::vector< Engine::Algorithm > getCapabilities()
Definition: Engine.cpp:55
Definition: Engine.h:38
Engine(ENGINE *engine)
Definition: Engine.cpp:3
Definition: Engine.h:34
ENGINE * engine
Definition: Engine.h:157
Definition: Engine.h:39
Definition: Engine.h:48
Definition: Engine.h:30
CmdType
Definition: Engine.h:46
ENGINE * getEngine() const
Definition: Engine.cpp:162
Definition: Engine.h:50
Definition: Engine.h:36
Definition: Engine.h:51