mirror of
https://github.com/Valeh2012/PersonalVotingMachine
synced 2025-12-10 18:45:17 +02:00
first commit
This commit is contained in:
15
extended-setup/main/impl/models/ChoiceModel.cpp
Normal file
15
extended-setup/main/impl/models/ChoiceModel.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* @file ChoiceModel.cpp
|
||||
* @brief ChoiceModel implementation file
|
||||
* */
|
||||
|
||||
#include "model.h"
|
||||
|
||||
ChoiceModel::ChoiceModel(char* ssid, char * authToken){
|
||||
|
||||
this->ssid = ssid;
|
||||
this->authToken = authToken;
|
||||
this->choices = NULL;
|
||||
this->choice_list = new std::vector<choice_t>();
|
||||
this->ballot = NULL;
|
||||
}
|
||||
21
extended-setup/main/impl/models/EncryptionModel.cpp
Normal file
21
extended-setup/main/impl/models/EncryptionModel.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* @file EncryptionModel.cpp
|
||||
* @brief EncryptionModel implementation file
|
||||
* */
|
||||
|
||||
#include "model.h"
|
||||
|
||||
EncryptionModel::EncryptionModel(char* ballot, char* ssid, char * authToken, const uint8_t keypem[], int keypem_length){
|
||||
|
||||
this->ballot = ballot;
|
||||
this->ballotASN = NULL;
|
||||
this->ballotHash = NULL;
|
||||
this->ballotFileName = NULL;
|
||||
this->ballotLength = 0;
|
||||
this->rndBase64 = NULL;
|
||||
this->authToken = authToken;
|
||||
this->ssid = ssid;
|
||||
this->keypem = keypem;
|
||||
this->keypem_length = keypem_length;
|
||||
this->election_id = NULL;
|
||||
}
|
||||
13
extended-setup/main/impl/models/QRModel.cpp
Normal file
13
extended-setup/main/impl/models/QRModel.cpp
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @file QRModel.cpp
|
||||
* @brief QRModel implementation file
|
||||
* */
|
||||
|
||||
#include "model.h"
|
||||
|
||||
QRModel::QRModel(char* ssid, char* voteID, unsigned char* rndBase64){
|
||||
|
||||
this->ssid = ssid;
|
||||
this->voteID = voteID;
|
||||
this->rndBase64 = rndBase64;
|
||||
}
|
||||
30
extended-setup/main/impl/models/SignatureModel.cpp
Normal file
30
extended-setup/main/impl/models/SignatureModel.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* @file SignatureModel.cpp
|
||||
* @brief SignatureModel implementation file
|
||||
* */
|
||||
|
||||
#include "string.h"
|
||||
#include "model.h"
|
||||
|
||||
SignatureModel::SignatureModel(char* ssid, char * authToken, char* phone, char* id, unsigned char* ballotHash, size_t ballotLength, char* ballotFileName){
|
||||
|
||||
this->ssid = ssid;
|
||||
this->authToken = authToken;
|
||||
this->sscode = NULL;
|
||||
|
||||
memset(this->ID, 0, 12);
|
||||
memset(this->phone, 0, 13);
|
||||
memcpy(this->ID, id, 11);
|
||||
memcpy(this->phone, phone, 12);
|
||||
|
||||
this->ballotHash = ballotHash;
|
||||
this->ballotLength = ballotLength;
|
||||
this->ballotFileName = ballotFileName;
|
||||
this->SignedInfoHash = NULL;
|
||||
this->signature = NULL;
|
||||
this->Signature = NULL;
|
||||
this->certificate = NULL;
|
||||
this->SI_XML = NULL;
|
||||
this->SP_XML = NULL;
|
||||
this->SV_XML = NULL;
|
||||
}
|
||||
19
extended-setup/main/impl/models/UserModel.cpp
Normal file
19
extended-setup/main/impl/models/UserModel.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @file UserModel.cpp
|
||||
* @brief UserModel implementation file
|
||||
* */
|
||||
|
||||
#include "string.h"
|
||||
#include "model.h"
|
||||
|
||||
UserModel::UserModel(char* id, char* phone){
|
||||
|
||||
memset(this->ID, 0, 12);
|
||||
memset(this->phone, 0, 13);
|
||||
memcpy(this->ID, id, 11);
|
||||
memcpy(this->phone, phone, strlen(phone));
|
||||
|
||||
this->ssid = NULL;
|
||||
this->authToken = NULL;
|
||||
this->sscode = NULL;
|
||||
}
|
||||
15
extended-setup/main/impl/models/VoteModel.cpp
Normal file
15
extended-setup/main/impl/models/VoteModel.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* @file VoteModel.cpp
|
||||
* @brief VoteModel implementation file
|
||||
* */
|
||||
|
||||
#include "model.h"
|
||||
|
||||
VoteModel::VoteModel(char* ssid, char* authToken, unsigned char* voteBase64, char* choices){
|
||||
|
||||
this->ssid = ssid;
|
||||
this->authToken = authToken;
|
||||
this->choices = choices;
|
||||
this->voteBase64 = voteBase64;
|
||||
this->voteID = NULL;
|
||||
}
|
||||
17
extended-setup/main/impl/models/ZipModel.cpp
Normal file
17
extended-setup/main/impl/models/ZipModel.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @file ZipModel.cpp
|
||||
* @brief ZipModel implementation file
|
||||
* */
|
||||
|
||||
#include "model.h"
|
||||
|
||||
ZipModel::ZipModel(unsigned char* ballot, char* ballotFileName, size_t ballotLength, char* Signature){
|
||||
|
||||
this->ballot = ballot;
|
||||
this->ballotFileName = ballotFileName;
|
||||
this->ballotLength = ballotLength;
|
||||
this->Signature = Signature;
|
||||
this->authToken = NULL;
|
||||
this->ssid = NULL;
|
||||
this->voteBase64 = NULL;
|
||||
}
|
||||
Reference in New Issue
Block a user