
#include <memory>

#include <map>
#include <vector>
#include <string.h>
//#include "Symcipher.h"
#include "CryptoScheme.h"

using namespace std;

CryptoScheme::CryptoScheme() = default;
//CryptoScheme::CryptoScheme(string privateKeyPath) {
//
//    isSymmetric = true;
//
//    //**********************************************
//    //publicKeyPath = "";
//    //**********************************************
//
//    this->privateKeyPath = privateKeyPath;
//    if (this->privateKeyPath == "")
//     {
//         throw "Private key path cannot be null ";
//     }

//     if (!keysExist())
//     {
//         keyGen();
//     }

// read the keys from files.
//**********************************************
//publicKey = "";
//privateKey = FileUtils.readObjectFromFile(privateKeyPath);
//**********************************************
//}

// CryptoScheme(string publicKeyPath, String privateKeyPath) {

//     isSymmetric = false;
//     this.publicKeyPath = publicKeyPath;
//     this.privateKeyPath = privateKeyPath;

//     // without the public key we cannot do anything.
//     if (this.publicKeyPath == null)
//         throw new RuntimeException("Public key path cannot be null");

//     // if only public key path is given then the public key must exist, it cannot be created since a public key without a private key is useless.
//     if (this.privateKeyPath == null && !keysExist())
//         throw new RuntimeException("Could not find public key");

//     // if keys already exist, use them and don't create new ones. Otherwise generate new keys and save them in files.
//     if (this.privateKeyPath != null && !keysExist())
//         keyGen();

//     // read the keys from files.
//     publicKey = FileUtils.readObjectFromFile(publicKeyPath);

//     // sometimes a private key might not be provided, i.e in the server side when only the evaluate function is needed.
//     if (this.privateKeyPath != null)
//         privateKey = FileUtils.readObjectFromFile(privateKeyPath);
//     else
//         privateKey = null;
// }

/**
 * Check whether the required keys for the encryption scheme exist.
 *
 * @return true if the required keys exist and false otherwise
 */
// bool  CryptoScheme::keysExist() {
//     //**********************************************
//
//     if (!isSymmetric) {
//         File publicKey = new File(publicKeyPath);
//         if (!publicKey.exists())
//             return false;
//     }
//     //**********************************************
//
//     if (privateKeyPath != NULL) {
//         File privateKey = new File(privateKeyPath);
//         return privateKey.exists();
//     }
//
//     return true;
// }

/**
 * Generate a key for the cipher.
 */
//void  keyGen();
