ImagingTools Core SDK
CAesEncryption.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// OpenSSL includes
6#include <openssl/ossl_typ.h>
7
8// ImtCore includes
9#include <imtcrypt/CAesKey.h>
10
11
12namespace imtcrypt
13{
14
15
16class CAesEncryption
17{
18public:
19 CAesEncryption();
20 ~CAesEncryption();
21
22 virtual bool Encrypt(const QByteArray& inputData, const CAesKey& key, QByteArray& outputData) const;
23 virtual bool Decrypt(const QByteArray& inputData, const CAesKey& key, QByteArray& outputData) const;
24
25protected:
26 virtual void InitContext() const;
27 virtual void DestroyContext() const;
28
29protected:
30 mutable EVP_CIPHER_CTX* m_aesEncryptContext;
31 mutable EVP_CIPHER_CTX* m_aesDecryptContext;
32 CAesKey m_aesKey;
33};
34
35
36} //namespace imtcrypt
37
38
Cryptography and Encryption Services Module.