10Duke Scale C++ Client
Loading...
Searching...
No Matches
AsymmetricMessageDigest.h
1#ifndef TENDUKE_LIBCRYPTO_ASYMMETRICMESSAGEDIGEST_H
2#define TENDUKE_LIBCRYPTO_ASYMMETRICMESSAGEDIGEST_H
3
4#include "crypto/MessageDigestVerifier.h"
5
6#include "./LibcryptoPublicKey.h"
7
8#include <memory>
9#include <string>
10
11#include <openssl/evp.h>
12
13
14
15namespace tenduke { namespace crypto { namespace libcrypto {
16
17
24{
25public:
34 const std::string &algorithmName,
35 const LibcryptoPublicKey * verificationKey
36 );
37 ~AsymmetricMessageDigest() override;
38
39// tenduke::crypto::MessageDigestVerifier implementation
40public:
51 bool verify(
52 const void *message,
53 std::size_t messageLength,
54 const void *signature,
55 std::size_t signatureLength
56 ) override;
57
58private:
59 const LibcryptoPublicKey * const verificationKey;
60 const EVP_MD *digest;
61 const std::unique_ptr<EVP_MD_CTX, decltype(EVP_MD_CTX_free) *> ctx;
62};
63
64
65}}}
66
67#endif // TENDUKE_LIBCRYPTO_ASYMMETRICMESSAGEDIGEST_H
Verifies message by computing digest for message and comparing the computed signature to the provided...
Definition MessageDigestVerifier.h:17
Libcrypto-implementation of asymmetric tenduke::crypto::MessageDigestVerifier.
Definition AsymmetricMessageDigest.h:24
bool verify(const void *message, std::size_t messageLength, const void *signature, std::size_t signatureLength) override
Verifies the signature.
Definition AsymmetricMessageDigest.cpp:34
Libcrypto-implementation of a public key definition.
Definition LibcryptoPublicKey.h:19
libcrypto based implementations of cryptography services.
Definition AsymmetricMessageDigest.h:15
Cryptography services.
Definition CryptoException.h:7
Root for classes, functions and globals of 10Duke C++ Client.
Definition BackendConfiguration.h:7