Examples of TorParsingException


Examples of com.subgraph.orchid.TorParsingException

 
  private static int stringToPort(String port) {
    try {
      final int portValue = Integer.parseInt(port);
      if(!isValidPort(portValue))
        throw new TorParsingException("Illegal port value: "+ port);
      return portValue;
    } catch(NumberFormatException e) {
      throw new TorParsingException("Could not parse port value: "+ port);
    }
  }
View Full Code Here

Examples of com.subgraph.orchid.TorParsingException

  }

  private static PolicyRule createRule(String rule, boolean isAccept) {
    final String[] args = rule.split(":");
    if(args.length != 2)
      throw new TorParsingException("Could not parse exit policy rule: "+ rule);

    return new PolicyRule(parseNetwork(args[0]), parsePortRange(args[1]), isAccept);
  }
View Full Code Here

Examples of com.subgraph.orchid.TorParsingException

  static public TorSignature createFromPEMBuffer(String buffer) {
    BufferedReader reader = new BufferedReader(new StringReader(buffer));
    final String header = nextLine(reader);
    if(!(SIGNATURE_BEGIN.equals(header) || ID_SIGNATURE_BEGIN.equals(header)))
      throw new TorParsingException("Did not find expected signature BEGIN header");
    return new TorSignature(Base64.decode(parseBase64Data(reader)), DigestAlgorithm.DIGEST_SHA1)
  }
View Full Code Here

Examples of com.subgraph.orchid.TorParsingException

  }
  static String nextLine(BufferedReader reader) {
    try {
      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
TOP
Copyright © 2018 www.massapi.com. 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.