public static void main(String[] args) {
		// Kolla vad detta betyder när vi analyserar säkerheten
		try {
			RecordHolder rh = new RecordHolder();
			String[] patNames = {"A", "B", "C"};
			String[] nurses = {"D", "E", "F"};
			String[] docNames = {"G", "H", "I"};
			String[] divs = {"Vattendroppen", "Solstrålen"};
			Doctor[] docs = new Doctor[3];
			int index = 0;
			CertificateFactory certF = CertificateFactory.getInstance("X.509");
			for(String name : docNames){
				Certificate cert = certF.generateCertificate(new FileInputStream("./keys/server/cert_" + name + ".pem"));
				docs[index] = new Doctor(name, divs[index/2], cert);
				rh.addDoctor(docs[index]);
				index++;
			}
			index = 0;

			rh.addPatient(new Patient(patNames[0], docs[0], certF.generateCertificate(new FileInputStream("./keys/server/cert_" + patNames[0] + ".pem"))));
			rh.addPatient(new Patient(patNames[1], docs[0],  certF.generateCertificate(new FileInputStream("./keys/server/cert_" + patNames[0] + ".pem"))));
			rh.addPatient(new Patient(patNames[2], docs[2],  certF.generateCertificate(new FileInputStream("./keys/server/cert_" + patNames[0] + ".pem"))));

			rh.addNurse(new Nurse("D", divs[0], certF.generateCertificate(new FileInputStream("./keys/server/cert_D.pem"))));
			rh.addNurse(new Nurse("E", divs[0],  certF.generateCertificate(new FileInputStream("./keys/server/cert_E.pem"))));
			rh.addNurse(new Nurse("F", divs[1],  certF.generateCertificate(new FileInputStream("./keys/server/cert_F.pem"))));

			rh.setGov(new Government("J", certF.generateCertificate(new FileInputStream("./keys/server/cert_J.pem"))));

			SSLContext ctx;
			KeyManagerFactory kmf;
			KeyStore ks;
			TrustManagerFactory tmf;
			char[] passphrase = "jagkan".toCharArray();

			ctx = SSLContext.getInstance("SSLv3");
			kmf = KeyManagerFactory.getInstance("SunX509");
			ks = KeyStore.getInstance("JKS");
			tmf = TrustManagerFactory.getInstance("SunX509");

			ks.load(new FileInputStream("./keys/server/keystore"), passphrase);

			kmf.init(ks, passphrase);
			tmf.init(ks);
			ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);

			SSLServerSocketFactory factory = ctx.getServerSocketFactory();
			SSLServerSocket serverSocket = (SSLServerSocket)factory.createServerSocket(PORT);
			serverSocket.setNeedClientAuth(true);

			System.out.println(rh.personsToString());

			System.out.println("Server started. Listening on port " + PORT + ".");
			SSLSocket clientSocket = (SSLSocket)serverSocket.accept();
			ClientProxy client = new ClientProxy(clientSocket, rh);
			Server server = new Server(client);
			server.serve();
		} catch (UnrecoverableKeyException e){
			e.printStackTrace();
		} catch (CertificateException e){
			e.printStackTrace();
		} catch (NoSuchAlgorithmException e){
			e.printStackTrace();
		} catch (KeyStoreException e){
			e.printStackTrace();
		} catch (KeyManagementException e){
			e.printStackTrace();
		} catch (IOException e){
			e.printStackTrace();
		}
	}