SeComLib
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Macros Pages
secure_face_recognition/main.cpp
Go to the documentation of this file.
1 /*
2 SeComLib
3 Copyright 2012-2013 TU Delft, Information Security & Privacy Lab (http://isplab.tudelft.nl/)
4 
5 Contributors:
6 Inald Lagendijk (R.L.Lagendijk@TUDelft.nl)
7 Mihai Todor (todormihai@gmail.com)
8 Thijs Veugen (P.J.M.Veugen@tudelft.nl)
9 Zekeriya Erkin (z.erkin@tudelft.nl)
10 
11 Licensed under the Apache License, Version 2.0 (the "License");
12 you may not use this file except in compliance with the License.
13 You may obtain a copy of the License at
14 
15 http://www.apache.org/licenses/LICENSE-2.0
16 
17 Unless required by applicable law or agreed to in writing, software
18 distributed under the License is distributed on an "AS IS" BASIS,
19 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 See the License for the specific language governing permissions and
21 limitations under the License.
22 */
31 #include "main.h"
32 
42 int main (int argc, char *argv[]) {
43  try {
44  //the first command line parameter always contains the name of the application
45  if (argc > 1) {
46  //a custom configuration file was specified
47  Utils::Config::SetConfigFile(std::string(argv[1]));
48  }
49 
51  std::shared_ptr<Client> client = std::make_shared<Client>();
52  std::shared_ptr<Server> server = std::make_shared<Server>(client->paillierCryptoProvider.GetPublicKey(), client->dgkCryptoProvider.GetPublicKey());
53 
54  server->SetClient(client);
55  client->SetServer(server);
56 
58  client->StartSimulation();
59  }
60  catch (const std::runtime_error &exception) {
61  std::cout << exception.what() << std::endl;
62  }
63  catch (const std::exception &exception) {
64  std::cout << exception.what() << std::endl;
65  }
66  //it won't catch low level exceptions, like division by 0, produced by GMP...
67  catch (...) {
68  std::cout << "Unexpected exception occured." << std::endl;
69  }
70  return 0;
71 }
Secure Face Recognition main header.
int main(int argc, char *argv[])