-
Notifications
You must be signed in to change notification settings - Fork 0
/
datamanagement.h
48 lines (32 loc) · 1.43 KB
/
datamanagement.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef DATAMANAGEMENT_H
#define DATAMANAGEMENT_H
#include <QtSql>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlRecord>
#include <QByteArray>
#include <qaesencryption.h>
#include <qrsaencryption.h>
class DataManagement
{
public:
explicit DataManagement();
virtual ~DataManagement();
protected:
bool readDataSQL(QSqlDatabase&, QSqlQuery&, int, QString&, QString&, QString&);
void writeDataSQL(QSqlDatabase&, QSqlQuery&, int, QString&, QString&, QString&);
bool deleteDataSQL(QSqlDatabase&, QSqlQuery&, int);
QByteArray readDataSQL_settingTable(QSqlDatabase&, QSqlQuery&, QString);
void writeDataSQL_settingTable(QSqlDatabase&, QSqlQuery&, int, QString, QByteArray&);
bool readDataSQL_dataTable(QSqlDatabase&, QSqlQuery&, int, QByteArray&, QByteArray&, QByteArray&);
bool writeDataSQL_dataTable(QSqlDatabase&, QSqlQuery&, int, QByteArray, QByteArray, QByteArray);
bool readDataSQL_keysTable(QSqlDatabase&, QSqlQuery&, int, QByteArray&, QByteArray&);
bool writeDataSQL_keysTable(QSqlDatabase&, QSqlQuery&, int, QByteArray, QByteArray);
bool deleteDataSQL_keysTable(QSqlDatabase&, QSqlQuery&, int);
QByteArray encryptAES(QString, QByteArray&, QByteArray&);
QString decryptAES(QByteArray&, QByteArray&, QByteArray&);
void generateKey(QByteArray&, QByteArray&);
private:
QRSAEncryption generatorObj;
};
#endif // DATAMANAGEMENT_H