10Duke Enterprise C++ SDK
Toggle main menu visibility
Loading...
Searching...
No Matches
MessageDigest.h
1
#ifndef TENDUKE_CRYPTO_MESSAGEDIGEST_H
2
#define TENDUKE_CRYPTO_MESSAGEDIGEST_H
3
4
#include "utl/BinaryData.h"
5
#include <cstddef>
6
#include <memory>
7
#include <string>
8
9
namespace
tenduke
{
namespace
crypto
{
10
12
const
std::size_t
SHA256_HASH_LENGTH_BYTES
= 32;
13
20
class
MessageDigest
21
{
22
public
:
24
enum
Algorithm
{
25
NONE,
26
SHA256
27
};
28
29
public
:
30
virtual
~MessageDigest
() =
default
;
31
36
virtual
std::size_t
length
()
const
= 0;
37
45
virtual
MessageDigest
*
update
(
46
const
unsigned
char
* message,
47
std::size_t messageLength
48
) = 0;
49
55
virtual
void
digestTo
(
unsigned
char
* messageDigest) = 0;
56
62
virtual
std::unique_ptr<tenduke::utl::BinaryData>
digest
() = 0;
63
69
static
std::string
algorithmToString
(
enum
MessageDigest::Algorithm
algorithm);
70
76
static
enum
MessageDigest::Algorithm
stringToAlgorithm
(
const
std::string &
string
);
77
83
static
enum
MessageDigest::Algorithm
stringToAlgorithm
(
const
char
*
string
);
84
};
85
86
87
}}
88
89
#endif
// TENDUKE_CRYPTO_MESSAGEDIGEST_H
tenduke::crypto::MessageDigest
Simple MessageDigest -service.
Definition
MessageDigest.h:21
tenduke::crypto::MessageDigest::update
virtual MessageDigest * update(const unsigned char *message, std::size_t messageLength)=0
Updates the digest.
tenduke::crypto::MessageDigest::stringToAlgorithm
static enum MessageDigest::Algorithm stringToAlgorithm(const std::string &string)
Converts string to algorithm.
Definition
MessageDigest.cpp:15
tenduke::crypto::MessageDigest::digest
virtual std::unique_ptr< tenduke::utl::BinaryData > digest()=0
Computes the digest.
tenduke::crypto::MessageDigest::length
virtual std::size_t length() const =0
Returns length (in bytes) of the resulting digest.
tenduke::crypto::MessageDigest::algorithmToString
static std::string algorithmToString(enum MessageDigest::Algorithm algorithm)
Converts algorithm to string representation.
Definition
MessageDigest.cpp:5
tenduke::crypto::MessageDigest::digestTo
virtual void digestTo(unsigned char *messageDigest)=0
Computes the digest to pre-allocated buffer.
tenduke::crypto::MessageDigest::Algorithm
Algorithm
Supported algorithms.
Definition
MessageDigest.h:24
tenduke::crypto
Cryptography services.
Definition
AbstractCiphers.h:12
tenduke::crypto::SHA256_HASH_LENGTH_BYTES
const std::size_t SHA256_HASH_LENGTH_BYTES
Length of SHA256 hash binary representation in bytes.
Definition
MessageDigest.h:12
tenduke
Root for classes, functions and globals of 10Duke C++ Client.
Definition
APIRequest.h:4
core
core
src
crypto
MessageDigest.h
Generated by
1.17.0