easyssl 0.50.142aaef
EasySSL is base back end library for your c++ Qt projects.
icrypto.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 I_CRYPTO_H
10#define I_CRYPTO_H
11
12#include "global.h"
13#include "qssl.h"
14#include <QByteArray>
15
16namespace EasySSL {
17
22{
23
24public:
25
29 enum Features {
31 Signing = 0x01,
33 Encryption = 0x02
34 };
35
42 bool makeKeys(QByteArray &pubKey, QByteArray &privKey) const;
43
48 virtual QSsl::KeyAlgorithm keyAlgorithm() const = 0;
49
55 virtual Features supportedFeatures() const = 0;
56
64 virtual QByteArray decrypt(const QByteArray& message, const QByteArray& key) = 0;
65
73 virtual QByteArray encrypt(const QByteArray& message, const QByteArray& key) = 0;
74
82 virtual QByteArray signMessage(const QByteArray& message, const QByteArray& key) const = 0;
83
92 virtual bool checkSign(const QByteArray& message,
93 const QByteArray& signature,
94 const QByteArray& key) const = 0;
95
100 virtual void * makeRawKeys() const = 0;
101};
102
103}
104#endif // I_CRYPTO_H
The ICrypto class, This is base interface that provide encryption functionality.
Definition icrypto.h:22
virtual QSsl::KeyAlgorithm keyAlgorithm() const =0
keyAlgorithm This method should be return Qt Key algorithm (needed for generate cetrificates....
virtual void * makeRawKeys() const =0
makeKeys This method generate the public and private keys of the ECDSA.
Features
The Features enum this is list of the supported description features.
Definition icrypto.h:29
virtual QByteArray signMessage(const QByteArray &message, const QByteArray &key) const =0
signMessage This method should be sign the message using the key.
virtual QByteArray encrypt(const QByteArray &message, const QByteArray &key)=0
encrypt This method encrypt message using key.
virtual QByteArray decrypt(const QByteArray &message, const QByteArray &key)=0
decrypt This method decrypt message using key.
virtual bool checkSign(const QByteArray &message, const QByteArray &signature, const QByteArray &key) const =0
checkSign This method should be check signature of the message using the key.
virtual Features supportedFeatures() const =0
supportedFeatures This method should return supported featurs of the current encryption algorithm
#define EASYSSL_EXPORT
Definition global.h:18