示例#1
0
  @Override
  public boolean putCryptoCollection(CryptoMessageCollection collection, EncryptionLayer layer) {
    if (isLast()) {
      System.out.println("# Result after " + layer + " encryption stage");
      int i = 0;
      for (CryptoMessage msg : collection.getList())
        System.out.println("[" + i++ + "] " + msg.getMessage());
    }

    try {
      System.out.println("<-- Sending collection to " + settings.getNext());
      MixServerInterface node = (MixServerInterface) Naming.lookup(settings.getNext());

      for (String v : settings.getVerifyServers()) {
        System.out.println("<-- Sending to verifier " + v);
        VerifyServerInterface veri = (VerifyServerInterface) Naming.lookup(v);
        veri.putCryptoCollection(collection);
        /*
        RemoteHandler veri = info.getRemote();
        ((org.juddholm.mixnet.verifyserver.rmi.RMIInput) veri.getInputHandler()).putCryptoCollection(collection);
        */
      }

      if (!(isLast() && layer == EncryptionLayer.FINAL)) {
        node.putCryptoCollection(collection);
      }

    } catch (RemoteException | MalformedURLException | NotBoundException e) {
      return false;
    }

    return true;
  }
示例#2
0
 @Override
 public void putCryptoCollection(CryptoMessageCollection collection) throws RemoteException {
   try {
     System.out.println(
         "--> Got collection from "
             + RemoteServer.getClientHost()
             + " with "
             + collection.size()
             + " votes and "
             + collection.layers()
             + " layers!");
   } catch (ServerNotActiveException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   }
   mix.putCryptoCollection(collection);
 }