Botan: src/engine/dyn_engine/dyn_engine.h Source File

Botan 1.10.17

dyn_engine.h
Go to the documentation of this file.
1 /**
2 * Dynamically Loaded Engine
3 * (C) 2010 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7
8 #ifndef BOTAN_DYN_LOADED_ENGINE_H__
9 #define BOTAN_DYN_LOADED_ENGINE_H__
10
11 #include <botan/engine.h>
12
13 namespace Botan {
14
15 /**
16 * Dynamically_Loaded_Engine just proxies the requests to the underlying
17 * Engine object, and handles load/unload details
18 */
19 class BOTAN_DLL Dynamically_Loaded_Engine : public Engine
20 {
21 public:
22 /**
23 * @param lib_path full pathname to DLL to load
24 */
25 Dynamically_Loaded_Engine(const std::string& lib_path);
26
27 ~Dynamically_Loaded_Engine();
28
29 std::string provider_name() const { return engine->provider_name(); }
30
31 BlockCipher* find_block_cipher(const SCAN_Name& algo_spec,
32 Algorithm_Factory& af) const
33 {
34 return engine->find_block_cipher(algo_spec, af);
35 }
36
37 StreamCipher* find_stream_cipher(const SCAN_Name& algo_spec,
38 Algorithm_Factory& af) const
39 {
40 return engine->find_stream_cipher(algo_spec, af);
41 }
42
43 HashFunction* find_hash(const SCAN_Name& algo_spec,
44 Algorithm_Factory& af) const
45 {
46 return engine->find_hash(algo_spec, af);
47 }
48
49 MessageAuthenticationCode* find_mac(const SCAN_Name& algo_spec,
50 Algorithm_Factory& af) const
51 {
52 return engine->find_mac(algo_spec, af);
53 }
54
55 PBKDF* find_pbkdf(const SCAN_Name& algo_spec,
56 Algorithm_Factory& af) const
57 {
58 return engine->find_pbkdf(algo_spec, af);
59 }
60
61 Modular_Exponentiator* mod_exp(const BigInt& n,
62 Power_Mod::Usage_Hints hints) const
63 {
64 return engine->mod_exp(n, hints);
65 }
66
67 Keyed_Filter* get_cipher(const std::string& algo_spec,
68 Cipher_Dir dir,
69 Algorithm_Factory& af)
70 {
71 return engine->get_cipher(algo_spec, dir, af);
72 }
73
74 PK_Ops::Key_Agreement*
75 get_key_agreement_op(const Private_Key& key) const
76 {
77 return engine->get_key_agreement_op(key);
78 }
79
80 PK_Ops::Signature*
81 get_signature_op(const Private_Key& key) const
82 {
83 return engine->get_signature_op(key);
84 }
85
86 PK_Ops::Verification*
87 get_verify_op(const Public_Key& key) const
88 {
89 return engine->get_verify_op(key);
90 }
91
92 PK_Ops::Encryption*
93 get_encryption_op(const Public_Key& key) const
94 {
95 return engine->get_encryption_op(key);
96 }
97
98 PK_Ops::Decryption*
99 get_decryption_op(const Private_Key& key) const
100 {
101 return engine->get_decryption_op(key);
102 }
103
104 private:
105 class Dynamically_Loaded_Library* lib;
106 Engine* engine;
107 };
108
109 }
110
111 #endif
Botan::Dynamically_Loaded_Engine::provider_name
std::string provider_name() const
Definition: dyn_engine.h:29
Botan::Dynamically_Loaded_Engine::get_key_agreement_op
PK_Ops::Key_Agreement * get_key_agreement_op(const Private_Key &key) const
Definition: dyn_engine.h:75
Botan::Algorithm_Factory
Definition: algo_factory.h:34
Botan::BigInt
Definition: bigint.h:22
Botan::Keyed_Filter
Definition: key_filt.h:20
Botan::Private_Key
Definition: pk_keys.h:86
Botan::Dynamically_Loaded_Engine
Definition: dyn_engine.h:19
Botan::Dynamically_Loaded_Engine::get_signature_op
PK_Ops::Signature * get_signature_op(const Private_Key &key) const
Definition: dyn_engine.h:81
Botan::PK_Ops::Signature
Definition: pk_ops.h:49
Botan::Dynamically_Loaded_Engine::find_stream_cipher
StreamCipher * find_stream_cipher(const SCAN_Name &algo_spec, Algorithm_Factory &af) const
Definition: dyn_engine.h:37
Botan::MessageAuthenticationCode
Definition: mac.h:20
Botan::Dynamically_Loaded_Engine::get_verify_op
PK_Ops::Verification * get_verify_op(const Public_Key &key) const
Definition: dyn_engine.h:87
Botan::Engine
Definition: engine.h:32
Botan::Dynamically_Loaded_Engine::get_cipher
Keyed_Filter * get_cipher(const std::string &algo_spec, Cipher_Dir dir, Algorithm_Factory &af)
Definition: dyn_engine.h:67
Botan::StreamCipher
Definition: stream_cipher.h:18
Botan
Definition: algo_base.h:14
Botan::Dynamically_Loaded_Library
Definition: dyn_load.h:18
Botan::PK_Ops::Key_Agreement
Definition: pk_ops.h:145
Botan::Dynamically_Loaded_Engine::mod_exp
Modular_Exponentiator * mod_exp(const BigInt &n, Power_Mod::Usage_Hints hints) const
Definition: dyn_engine.h:61
Botan::SCAN_Name
Definition: scan_name.h:21
Botan::Public_Key
Definition: pk_keys.h:21
Botan::Dynamically_Loaded_Engine::find_block_cipher
BlockCipher * find_block_cipher(const SCAN_Name &algo_spec, Algorithm_Factory &af) const
Definition: dyn_engine.h:31
Botan::Dynamically_Loaded_Engine::get_encryption_op
PK_Ops::Encryption * get_encryption_op(const Public_Key &key) const
Definition: dyn_engine.h:93
Botan::HashFunction
Definition: hash.h:20
Botan::Dynamically_Loaded_Engine::find_hash
HashFunction * find_hash(const SCAN_Name &algo_spec, Algorithm_Factory &af) const
Definition: dyn_engine.h:43
Botan::Power_Mod::Usage_Hints
Usage_Hints
Definition: pow_mod.h:35
Botan::Dynamically_Loaded_Engine::get_decryption_op
PK_Ops::Decryption * get_decryption_op(const Private_Key &key) const
Definition: dyn_engine.h:99
Botan::Dynamically_Loaded_Engine::find_pbkdf
PBKDF * find_pbkdf(const SCAN_Name &algo_spec, Algorithm_Factory &af) const
Definition: dyn_engine.h:55
Botan::Dynamically_Loaded_Engine::find_mac
MessageAuthenticationCode * find_mac(const SCAN_Name &algo_spec, Algorithm_Factory &af) const
Definition: dyn_engine.h:49
Botan::Cipher_Dir
Cipher_Dir
Definition: sym_algo.h:87
Botan::PK_Ops::Decryption
Definition: pk_ops.h:35
Botan::PK_Ops::Encryption
Definition: pk_ops.h:21
Botan::PK_Ops::Verification
Definition: pk_ops.h:85
Botan::BlockCipher
Definition: block_cipher.h:18
Botan::PBKDF
Definition: pbkdf.h:21
Botan::Modular_Exponentiator
Definition: pow_mod.h:18