10Duke Enterprise C++ SDK
Toggle main menu visibility
Loading...
Searching...
No Matches
WinCNGHashFactory.h
1
#ifndef TENDUKE_CRYPTO_WIN_CNG_WINCNGHASHFACTORY_H
2
#define TENDUKE_CRYPTO_WIN_CNG_WINCNGHASHFACTORY_H
3
4
#include "crypto/msgauthn/HashFactory.h"
5
6
#include <mutex>
7
8
#include <windows.h>
9
#include <bcrypt.h>
10
11
namespace
tenduke
{
namespace
crypto
{
namespace
win {
namespace
cng {
12
13
class
WinCNGAlgorithms
14
{
15
16
public
:
17
WinCNGAlgorithms();
18
~WinCNGAlgorithms();
19
20
public
:
21
::BCRYPT_ALG_HANDLE get(
::tenduke::crypto::HashAlgorithm
algorithm);
22
23
private
:
24
// Very simple, we only support one alg.
25
::BCRYPT_ALG_HANDLE sha256Handle;
26
std::recursive_mutex mutex;
27
};
28
29
33
class
WinCNGHashFactory :
public
::tenduke::crypto::HashFactory
34
{
35
36
public
:
37
WinCNGHashFactory();
38
39
// ::tenduke::crypto::HashFactory implementation
40
public
:
41
std::unique_ptr<::tenduke::crypto::CryptographicHash>
create
(
::tenduke::crypto::HashAlgorithm
algorithm)
const override
;
42
43
private
:
44
const
std::shared_ptr<WinCNGAlgorithms> algorithms;
45
};
46
47
}}}}
48
49
#endif
//TENDUKE_CRYPTO_WIN_CNG_WINCNGHASHFACTORY_H
tenduke::crypto::HashFactory
Creates cryptographic hash functions.
Definition
HashFactory.h:13
tenduke::crypto::win::cng::WinCNGHashFactory::create
std::unique_ptr<::tenduke::crypto::CryptographicHash > create(::tenduke::crypto::HashAlgorithm algorithm) const override
Creates a new message digest.
Definition
WinCNGHashFactory.cpp:65
tenduke::crypto
Cryptography services.
Definition
AbstractCiphers.h:18
tenduke::crypto::HashAlgorithm
HashAlgorithm
Currently supported hash algorithms.
Definition
HashAlgorithm.h:13
tenduke
Root for classes, functions and globals of 10Duke C++ Client.
Definition
APIRequest.h:4
core
services
windows
src
crypto
msgauthn
WinCNGHashFactory.h
Generated by
1.17.0