10Duke Enterprise C++ SDK
Toggle main menu visibility
Loading...
Searching...
No Matches
LibcryptoAESCipher.h
1
#ifndef TENDUKE_CRYPTO_LIBCRYPTO_LIBCRYPTOAESCIPHER_H
2
#define TENDUKE_CRYPTO_LIBCRYPTO_LIBCRYPTOAESCIPHER_H
3
4
#include "crypto/symmetric/aes/AESGCMCipher.h"
5
#include "utl/DataSink.h"
6
7
#include <openssl/evp.h>
8
9
namespace
tenduke
{
namespace
crypto
{
namespace
aes {
namespace
libcrypto {
10
11
class
LibcryptoAESKey
;
12
16
class
LibcryptoAESCipher :
public
::tenduke::crypto::aes::AESGCMCipher
17
{
18
public
:
19
explicit
LibcryptoAESCipher(const ::tenduke::crypto::aes::libcrypto::LibcryptoAESKey &key);
20
21
// Ciphers are not copyable
22
LibcryptoAESCipher(
const
LibcryptoAESCipher&) =
delete
;
23
LibcryptoAESCipher& operator=(
const
LibcryptoAESCipher&) =
delete
;
24
25
// Ciphers are movable
26
LibcryptoAESCipher(LibcryptoAESCipher&& other)
noexcept
=
default
;
27
LibcryptoAESCipher& operator=(LibcryptoAESCipher&& other)
noexcept
=
default
;
28
29
// tenduke::crypto::Cipher implementation
30
void
decryptData
(const ::tenduke::utl::DataSpan &ciphertext,
::tenduke::utl::DataSink
&plaintext)
const override
;
31
void
encryptData
(const ::tenduke::utl::DataSpan &plaintext,
::tenduke::utl::DataSink
&ciphertext)
const override
;
32
33
// tenduke::crypto::aes::AESGCMCipher implementation
34
void
encryptData
(
35
const ::tenduke::utl::DataSpan &nonce,
36
const ::tenduke::utl::DataSpan &plaintext,
37
::tenduke::utl::DataSink
&ciphertext
38
)
const override
;
39
40
private
:
41
std::unique_ptr<::tenduke::utl::DataSpan> key;
42
const
EVP_CIPHER *cipher;
43
};
44
45
}}}}
46
47
#endif
//TENDUKE_CRYPTO_LIBCRYPTO_LIBCRYPTOAESCIPHER_H
tenduke::crypto::aes::AESGCMCipher
An AES-GCM cipher that supports encryption with an externally provided nonce.
Definition
AESGCMCipher.h:17
tenduke::crypto::aes::libcrypto::LibcryptoAESCipher::decryptData
void decryptData(const ::tenduke::utl::DataSpan &ciphertext, ::tenduke::utl::DataSink &plaintext) const override
Utility method to decrypt data.
Definition
LibcryptoAESCipher.cpp:111
tenduke::crypto::aes::libcrypto::LibcryptoAESCipher::encryptData
void encryptData(const ::tenduke::utl::DataSpan &nonce, const ::tenduke::utl::DataSpan &plaintext, ::tenduke::utl::DataSink &ciphertext) const override
Encrypts data using the provided nonce.
tenduke::crypto::aes::libcrypto::LibcryptoAESCipher::encryptData
void encryptData(const ::tenduke::utl::DataSpan &plaintext, ::tenduke::utl::DataSink &ciphertext) const override
Utility method to encrypt data.
tenduke::crypto::aes::libcrypto::LibcryptoAESKey
Libcrypto AES secret key implementation.
Definition
LibcryptoAESKey.h:13
tenduke::utl::DataSink
A sink to which binary data can be appended.
Definition
DataSink.h:14
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
default
src
crypto
symmetric
aes
LibcryptoAESCipher.h
Generated by
1.17.0