mirror of
https://github.com/Valeh2012/PersonalVotingMachine
synced 2025-12-08 10:05:12 +02:00
first commit
This commit is contained in:
13
basic-setup/main/impl/models/BluetoothModel.cpp
Normal file
13
basic-setup/main/impl/models/BluetoothModel.cpp
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @file BluetoothModel.cpp
|
||||
* @brief BluetoothModel implementation file
|
||||
* */
|
||||
|
||||
#include "model.h"
|
||||
|
||||
BluetoothModel::BluetoothModel(char *ssid, char* voteID, unsigned char * rndBase64){
|
||||
|
||||
this->ssid = ssid;
|
||||
this->voteID = voteID;
|
||||
this->rndBase64 = rndBase64;
|
||||
}
|
||||
16
basic-setup/main/impl/models/ChoiceModel.cpp
Normal file
16
basic-setup/main/impl/models/ChoiceModel.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* @file ChoiceModel.cpp
|
||||
* @brief ChoiceModel implementation file
|
||||
* */
|
||||
|
||||
#include <vector>
|
||||
#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
basic-setup/main/impl/models/EncryptionModel.cpp
Normal file
21
basic-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;
|
||||
}
|
||||
30
basic-setup/main/impl/models/SignatureModel.cpp
Normal file
30
basic-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);
|
||||
strncpy(this->ID, id, 11);
|
||||
strncpy(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
basic-setup/main/impl/models/UserModel.cpp
Normal file
19
basic-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, 12);
|
||||
strncpy(this->ID, id, 11);
|
||||
strncpy(this->phone, phone, 12);
|
||||
|
||||
ssid = NULL;
|
||||
authToken = NULL;
|
||||
sscode = NULL;
|
||||
}
|
||||
20
basic-setup/main/impl/models/VoteModel.cpp
Normal file
20
basic-setup/main/impl/models/VoteModel.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* @file VoteModel.cpp
|
||||
* @brief VoteModel implementation file
|
||||
* */
|
||||
|
||||
#include "string.h";
|
||||
#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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
19
basic-setup/main/impl/models/ZipModel.cpp
Normal file
19
basic-setup/main/impl/models/ZipModel.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @file ZipModel.cpp
|
||||
* @brief ZipModel implementation file
|
||||
* */
|
||||
|
||||
#include "string.h"
|
||||
#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