Package com.subgraph.orchid

Examples of com.subgraph.orchid.TorException


    refreshDescriptor();
  }

  void updateStatus(RouterStatus status) {
    if(!identityHash.equals(status.getIdentity()))
      throw new TorException("Identity hash does not match status update");
    this.status = status;
    this.cachedCountryCode = null;
    this.descriptor = null;
    refreshDescriptor();
  }
View Full Code Here


    else {
      inputStream.addInputCell(cell);
      synchronized(windowLock) {
        deliverWindow--;
        if(deliverWindow < 0)
          throw new TorException("Stream has negative delivery window");
      }
      considerSendingSendme();
    }
  }
View Full Code Here

    synchronized(windowLock) {
      while(packageWindow == 0) {
        try {
          windowLock.wait();
        } catch (InterruptedException e) {
          throw new TorException("Thread interrupted while waiting for stream package window");
        }
      }
      if(decrement)
        packageWindow--;
    }
View Full Code Here

 
  private static SecureRandom createRandom() {
    try {
      return SecureRandom.getInstance("SHA1PRNG");
    } catch (NoSuchAlgorithmException e) {
      throw new TorException(e);
    }
  }
View Full Code Here

  private MessageDigest createDigestInstance(boolean isDigest256) {
    try {
      final String algorithm = (isDigest256) ? TOR_DIGEST256_ALGORITHM : TOR_DIGEST_ALGORITHM;
      return MessageDigest.getInstance(algorithm);
    } catch (NoSuchAlgorithmException e) {
      throw new TorException(e);
    }
  }
View Full Code Here

      // Make a clone because #digest() will reset the MessageDigest instance
      // and we want to be able to use this class for running digests on circuits
      final MessageDigest clone = (MessageDigest) digestInstance.clone();
      return clone.digest();
    } catch (CloneNotSupportedException e) {
      throw new TorException(e);
    }
  }
View Full Code Here

    try {
      final MessageDigest clone = (MessageDigest) digestInstance.clone();
      clone.update(data, offset, length);
      return clone.digest();
    } catch (CloneNotSupportedException e) {
      throw new TorException(e);
    }
  }
View Full Code Here

   */
  public void update(String input) {
    try {
      digestInstance.update(input.getBytes("ISO-8859-1"));
    } catch (UnsupportedEncodingException e) {
      throw new TorException(e);
    }
  }
View Full Code Here

  static KeyPairGenerator createGenerator() {
    try {
      return KeyPairGenerator.getInstance("RSA");
    } catch (NoSuchAlgorithmException e) {
      throw new TorException(e);
    }
  }
View Full Code Here

   */
  public HybridEncryption() {
    try {
      cipher = Cipher.getInstance("RSA/ECB/OAEPWithSHA1AndMGF1Padding");
    } catch (NoSuchAlgorithmException e) {
      throw new TorException(e);
    } catch (NoSuchPaddingException 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.