Botan  2.1.0
Crypto and TLS for C++11
es_capi.h
Go to the documentation of this file.
1 /*
2 * Win32 CAPI EntropySource
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7 
8 #ifndef BOTAN_ENTROPY_SRC_WIN32_CAPI_H__
9 #define BOTAN_ENTROPY_SRC_WIN32_CAPI_H__
10 
11 #include <botan/entropy_src.h>
12 #include <vector>
13 
14 namespace Botan {
15 
16 /**
17 * Win32 CAPI Entropy Source
18 */
20  {
21  public:
22  std::string name() const override { return "win32_cryptoapi"; }
23 
24  size_t poll(RandomNumberGenerator& rng) override;
25 
26  /**
27  * Win32_Capi_Entropysource Constructor
28  * @param provs list of providers, separated by ':'
29  */
30  explicit Win32_CAPI_EntropySource(const std::string& provs = "");
31 
32  class CSP_Handle
33  {
34  public:
35  virtual size_t gen_random(uint8_t out[], size_t n) const = 0;
36  };
37  private:
38  std::vector<std::unique_ptr<CSP_Handle>> m_csp_provs;
39  };
40 
41 }
42 
43 #endif
size_t poll(RandomNumberGenerator &rng) override
Definition: es_capi.cpp:53
std::string name() const override
Definition: es_capi.h:22
virtual size_t gen_random(uint8_t out[], size_t n) const =0
Win32_CAPI_EntropySource(const std::string &provs="")
Definition: es_capi.cpp:75
Definition: alg_id.cpp:13