ImagingTools Core SDK
CRsaEncryption.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/rsa.h>
7
8// ImtCore includes
9#include <imtcrypt/CRsaKey.h>
10
11
12namespace imtcrypt
13{
14
15
16class CRsaEncryption
17{
18public:
19 CRsaEncryption();
20
21 bool Encrypt(const QByteArray& inputData, const CRsaKey& key, QByteArray& outputData) const;
22 bool Decrypt(const QByteArray& inputData, const CRsaKey& key, QByteArray& outputData) const;
23
24protected:
25 QByteArray GetRsaPrivateKey() const;
26 QByteArray GetRsaPublicKey() const;
27 bool SetRsaPrivateKey(const QByteArray &key) const;
28 bool SetRsaPublicKey(const QByteArray &key) const;
29
30private:
31 mutable RSA* m_rsaPublicKey;
32 mutable RSA* m_rsaPrivateKey;
33 mutable CRsaKey m_rsaKey;
34};
35
36
37} //namespace imtcrypt
38
39
Cryptography and Encryption Services Module.