Upravy a opravování kryptování
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
#ifndef EZ_APPLICATION_LICENCE_DISABLE
|
||||
|
||||
#ifndef PLC_LICENCE2_COMMON_H
|
||||
#define PLC_LICENCE2_COMMON_H
|
||||
|
||||
|
||||
#include <vector>
|
||||
#include "licenceCommon.h"
|
||||
#include "SDCard.h"
|
||||
@@ -13,9 +14,10 @@ public:
|
||||
LicenceELC2();
|
||||
LicenceELC2(LicenceIdentification &licIdentification);
|
||||
~LicenceELC2();
|
||||
|
||||
|
||||
string cid_cdsPath = "";
|
||||
string licenceFilePath = "";
|
||||
string licFileName = "";
|
||||
|
||||
Mapping mapping;
|
||||
|
||||
@@ -29,21 +31,21 @@ public:
|
||||
// struct __attribute__((__packed__)) LicencePublicHeader
|
||||
struct LicenceIdentDataHeader
|
||||
{
|
||||
BYTE licenceType {}; // EOSEOV, DRT ...
|
||||
BYTE licenceType{}; // EOSEOV, DRT ...
|
||||
BYTE licenceTypeVersion = 1; // verze licence, urcuje nuance sifrování a pojmenování souborů
|
||||
BYTE licenceIndex {}; // puvodní post fix, identifikátor pro více licencí
|
||||
BYTE licenceIndex{}; // puvodní post fix, identifikátor pro více licencí
|
||||
BYTE compatibilityVersion = 1; // udava verzi komplet PrivateContent
|
||||
BYTE licItemCount {}; // počet protokolů v linenci
|
||||
WORD publicHeaderLength {}; // délka veřejné hlavičy
|
||||
WORD cardSize {}; // velikost SD karty
|
||||
DWORD serialNumber = {}; // seriove cislo karty
|
||||
BYTE licItemCount{}; // počet protokolů v linenci
|
||||
WORD publicHeaderLength{}; // délka veřejné hlavičy
|
||||
WORD cardSize{}; // velikost SD karty
|
||||
DWORD serialNumber = {}; // seriove cislo karty
|
||||
};
|
||||
|
||||
///
|
||||
struct licDataItem
|
||||
{
|
||||
DWORD protoId {}; // id protokolu pro ktery je licence
|
||||
DWORD licCount {}; // pocet datovych bodu licence
|
||||
DWORD protoId{}; // id protokolu pro ktery je licence
|
||||
DWORD licCount{}; // pocet datovych bodu licence
|
||||
};
|
||||
|
||||
struct PublicHeader
|
||||
@@ -56,30 +58,31 @@ public:
|
||||
|
||||
struct PrivateContent // privátní šifrovaná část
|
||||
{
|
||||
LicenceIdentDataHeader licenceIdentHeader {};
|
||||
vector<licDataItem> dataItems {};
|
||||
WORD crc {};
|
||||
LicenceIdentDataHeader licenceIdentHeader{};
|
||||
vector<licDataItem> dataItems{};
|
||||
WORD crc{};
|
||||
};
|
||||
|
||||
struct LicenceBody
|
||||
{
|
||||
LicenceId licId {};
|
||||
LicenceIdentDataHeader licenceIdentHeader {};
|
||||
LicenceId licId{};
|
||||
LicenceIdentDataHeader licenceIdentHeader{};
|
||||
string publicHeader = ""; // JSON
|
||||
PrivateContent privateContent {};
|
||||
PrivateContent privateContent{};
|
||||
};
|
||||
|
||||
LicenceBody licBody {};
|
||||
SDCard sdCard {};
|
||||
LicenceIdentification lIdentification {};
|
||||
SDCard sdCard{};
|
||||
|
||||
protected:
|
||||
vector<unsigned char> cryptPrivateContent(const std::vector<unsigned char> &content);
|
||||
vector<unsigned char> decryptPrivateContent(const std::vector<unsigned char> &content);
|
||||
void initVector(BYTE (&iVector)[], BYTE (&key)[]);
|
||||
void initVector(BYTE *iVector, BYTE *key);
|
||||
string getLicenceName();
|
||||
LicenceBody licBody{};
|
||||
LicenceIdentification lIdentification{};
|
||||
|
||||
private:
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user