Fuzzer_TLS_Server_Creds() { Botan::DataSource_Memory cert_in(fixed_rsa_cert); Botan::DataSource_Memory key_in(fixed_rsa_key); m_rsa_cert.reset(new Botan::X509_Certificate(cert_in)); //m_rsa_key.reset(Botan::PKCS8::load_key(key_in, fuzzer_rng()); }
sc::private_key_ptr load_private_key(const std::string& key, const std::string& pass) { if(!bf::exists(key)) create_new_key(key, pass); std::ifstream key_in(key.c_str(), std::fstream::in | std::fstream::binary); if(!key_in.good()) throw std::runtime_error{"unable to load `" + key + "' for reading"}; auto r = sc::decode_private_key(key_in, pass); CHECK(r); return r; }
void Hill::setKey(const string &file) { ifstream key_in(file.c_str()); if(key_in.is_open()) { key_in >> blockSize; key = new MatrixXi(blockSize, blockSize); int value; for(int i = 0; i < blockSize; ++i) { for(int j = 0; j < blockSize; ++j) { key_in >> value; (*key)(i, j) = value; } } }