10Duke Enterprise C++ SDK
Toggle main menu visibility
Loading...
Searching...
No Matches
WinCNGHash.h
1
#ifndef TENDUKE_CRYPTO_WIN_CNG_WINCNGHASH_H
2
#define TENDUKE_CRYPTO_WIN_CNG_WINCNGHASH_H
3
4
#include "crypto/msgauthn/CryptographicHash.h"
5
#include "utl/FixedSizeBinaryData.h"
6
7
#include <memory>
8
9
#include <windows.h>
10
#include <bcrypt.h>
11
12
namespace
tenduke
{
namespace
crypto
{
namespace
win {
namespace
cng {
13
14
18
class
WinCNGHash
:
public
::tenduke::crypto::CryptographicHash
19
{
20
public
:
24
explicit
WinCNGHash
(::BCRYPT_ALG_HANDLE algorithm);
25
~WinCNGHash
()
override
;
26
27
// ::tenduke::crypto::MessageDigest implementation
28
public
:
29
std::size_t
length
()
const override
;
30
MessageDigest
*
update
(
31
const
unsigned
char
* message,
32
std::size_t messageLength
33
)
override
;
34
void
digestTo
(
unsigned
char
*
digest
)
override
;
35
std::unique_ptr<tenduke::utl::BinaryData>
digest
()
override
;
36
37
private
:
38
::BCRYPT_HASH_HANDLE handle;
39
size_t
digestLength;
40
std::unique_ptr<::tenduke::utl::FixedSizeBinaryData> digestBuffer;
41
};
42
43
}}}}
44
45
#endif
// TENDUKE_CRYPTO_WIN_CNG_WINCNGHASH_H
tenduke::crypto::CryptographicHash
A cryptographic hash function, like SHA-256.
Definition
CryptographicHash.h:12
tenduke::crypto::MessageDigest
Simple MessageDigest-service: E.g.
Definition
MessageDigest.h:18
tenduke::crypto::win::cng::WinCNGHash::digestTo
void digestTo(unsigned char *digest) override
Computes the digest to pre-allocated buffer.
Definition
WinCNGHash.cpp:40
tenduke::crypto::win::cng::WinCNGHash::length
std::size_t length() const override
Returns length (in bytes) of the resulting digest.
Definition
WinCNGHash.cpp:15
tenduke::crypto::win::cng::WinCNGHash::update
MessageDigest * update(const unsigned char *message, std::size_t messageLength) override
Updates the digest.
Definition
WinCNGHash.cpp:21
tenduke::crypto::win::cng::WinCNGHash::digest
std::unique_ptr< tenduke::utl::BinaryData > digest() override
Computes the digest.
Definition
WinCNGHash.cpp:54
tenduke::crypto::win::cng::WinCNGHash::WinCNGHash
WinCNGHash(::BCRYPT_ALG_HANDLE algorithm)
Constructs a new instance.
Definition
WinCNGHash.cpp:64
tenduke::crypto
Cryptography services.
Definition
AbstractCiphers.h:18
tenduke
Root for classes, functions and globals of 10Duke C++ Client.
Definition
APIRequest.h:4
core
services
windows
src
crypto
msgauthn
WinCNGHash.h
Generated by
1.17.0