10Duke Enterprise C++ SDK
Loading...
Searching...
No Matches
LibcryptoSignatureVerifier.h
1#ifndef TENDUKE_LIBCRYPTO_LIBCRYPTOSIGNATUREVERIFIER_H
2#define TENDUKE_LIBCRYPTO_LIBCRYPTOSIGNATUREVERIFIER_H
3
4#include "crypto/asymmetric/DigitalSignatureVerifier.h"
5
6#include "../asymmetric/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 );
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_LIBCRYPTOSIGNATUREVERIFIER_H
Verifies digital signatures.
Definition DigitalSignatureVerifier.h:12
Libcrypto-implementation of a public key definition.
Definition LibcryptoPublicKey.h:18
LibcryptoSignatureVerifier(const std::string &algorithmName, const LibcryptoPublicKey *verificationKey)
Constructs a new instance.
Definition LibcryptoSignatureVerifier.cpp:14
bool verify(const void *message, std::size_t messageLength, const void *signature, std::size_t signatureLength) override
Verifies the signature.
Definition LibcryptoSignatureVerifier.cpp:34
libcrypto based implementations of cryptography services.
Definition LibcryptoKey.h:8
Cryptography services.
Definition AbstractCiphers.h:18
Root for classes, functions and globals of 10Duke C++ Client.
Definition APIRequest.h:4