easyssl 0.50.142aaef
EasySSL is base back end library for your c++ Qt projects.
rsassl.h
Go to the documentation of this file.
1//#
2//# Copyright (C) 2021-2025 QuasarApp.
3//# Distributed under the GPLv3 software license, see the accompanying
4//# Everyone is permitted to copy and distribute verbatim copies
5//# of this license document, but changing it is not allowed.
6//#
7
8
9#ifndef RSASSL30_H
10#define RSASSL30_H
11
12#include "global.h"
13#include "icrypto.h"
14
15namespace EasySSL {
16
21{
26 enum RSAPadding {
27
29 NO_PADDING,
30
32 PKCS1_OAEP_PADDING,
33
35 PKCS1_PADDING,
36 };
37
38 enum RSABits {
39 RSA_Base = 1024,
40 RSA_2048 = 2 * RSA_Base,
41 RSA_3072 = 3 * RSA_Base,
42 RSA_4096 = 4 * RSA_Base,
43
44 };
45
46public:
47 RSASSL(RSAPadding padding = PKCS1_OAEP_PADDING);
48
49 void *makeRawKeys() const override;
50 Features supportedFeatures() const override;
51 QSsl::KeyAlgorithm keyAlgorithm() const override;
52
53 QByteArray signMessage(const QByteArray &inputData, const QByteArray &key) const override;
54 bool checkSign(const QByteArray &inputData, const QByteArray &signature, const QByteArray &key) const override;
55
60 QByteArray decrypt(const QByteArray &message, const QByteArray &key) override;
61
66 QByteArray encrypt(const QByteArray &message, const QByteArray &key) override;
67
72 RSAPadding padding() const;
73
79 void setPadding(RSAPadding newPadding);
80
85 RSABits bits() const;
86
91 void setBits(RSABits newBits);
92
93private:
94 int getRawOpenSSLPandingValue(RSAPadding panding);
95 int getPandingSize(RSAPadding panding);
96
97 RSAPadding _padding = PKCS1_OAEP_PADDING;
98 RSABits _bits = RSABits::RSA_3072;
99
100};
101
102}
103#endif // RSASSL30_H
The ICrypto class, This is base interface that provide encryption functionality.
Definition icrypto.h:22
Features
The Features enum this is list of the supported description features.
Definition icrypto.h:29
The RSASSL class This is wrapper for RSA algorithm of openssl 3.0 libraryry.
Definition rsassl.h:21
#define EASYSSL_EXPORT
Definition global.h:18