Package com.subgraph.orchid

Examples of com.subgraph.orchid.TorException


        return Cipher.getInstance("RSA/ECB/PKCS1Padding", "SunJCE");
      } catch (NoSuchProviderException e) {
        return Cipher.getInstance("RSA/ECB/PKCS1Padding");
      }
    } catch (NoSuchAlgorithmException e) {
      throw new TorException(e);
    } catch (NoSuchPaddingException e) {
      throw new TorException(e);
    }
  }
View Full Code Here


    status.updateCreatedTimestamp();
  }
 
  public Connection getConnection() {
    if(!isConnected())
      throw new TorException("Circuit is not connected.");
    return io.getConnection();
  }
View Full Code Here

    return nodeList.size();
  }

  public CircuitNode getFinalCircuitNode() {
    if(nodeList.isEmpty())
      throw new TorException("getFinalCircuitNode() called on empty circuit");
    return nodeList.get( getCircuitLength() - 1);
  }
View Full Code Here

    return command;
  }

  private String addressBytesToHostname() {
    if(addressType != SOCKS5_ADDRESS_HOSTNAME)
      throw new TorException("SOCKS 4 request is not a hostname request");
    final StringBuilder sb = new StringBuilder();
    for(int i = 1; i < addressBytes.length; i++) {
      char c = (char) (addressBytes[i] & 0xFF);
      sb.append(c);
    }
View Full Code Here

      final String line = reader.readLine();
      if(line == null)
        throw new TorParsingException("Did not find expected signature END header");
      return line;
    } catch (IOException e) {
      throw new TorException(e);
    }
  }
View Full Code Here

      return circuitManager.openExitStreamTo(request.getAddress(), request.getPort());
    }
  }

  private void sendHttpPage() {
    throw new TorException("Returning HTTP page not implemented");
  }
View Full Code Here

    executor = Executors.newCachedThreadPool();
  }

  public void addListeningPort(int port) {
    if(port <= 0 || port > 65535) {
      throw new TorException("Illegal listening port: "+ port);
    }
   
    synchronized(listeningPorts) {
      if(isStopped) {
        throw new IllegalStateException("Cannot add listening port because Socks proxy has been stopped");
      }
      if(listeningPorts.contains(port))
        return;
      listeningPorts.add(port);
      try {
        startListening(port);
        logger.fine("Listening for SOCKS connections on port "+ port);
      } catch (IOException e) {
        listeningPorts.remove(port);
        throw new TorException("Failed to listen on port "+ port +" : "+ e.getMessage());
      }
    }
   
  }
View Full Code Here

    try {
      final Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding");
      cipher.init(Cipher.ENCRYPT_MODE, keySpec);
      return cipher;
    } catch (GeneralSecurityException e) {
      throw new TorException(e);
    }
  }
View Full Code Here

    try {
      KeyGenerator generator = KeyGenerator.getInstance("AES");
      generator.init(128);
      return generator.generateKey();
    } catch (GeneralSecurityException e) {
      throw new TorException(e);
    }
  }
View Full Code Here

 
  private void encryptCounter() {
    try {
      cipher.doFinal(counter, 0, BLOCK_SIZE, counterOut, 0);
    } catch (GeneralSecurityException e) {
      throw new TorException(e);
    }
  }
View Full Code Here

TOP

Related Classes of com.subgraph.orchid.TorException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.