Examples of TorPublicKey


Examples of com.subgraph.orchid.crypto.TorPublicKey

    }
    if(certificate.isExpired()) {
      return SignatureStatus.STATUS_FAILED;
    }
   
    final TorPublicKey signingKey = certificate.getAuthoritySigningKey();
    final HexDigest d = (signature.useSha256()) ? signingHash256 : signingHash;
    if(!signingKey.verifySignature(signature.getSignature(), d)) {
      logger.warning("Signature failed on consensus for signing key: "+ signature.getSigningKeyDigest());
      return SignatureStatus.STATUS_FAILED;
    }
    return SignatureStatus.STATUS_VERIFIED;
  }
View Full Code Here

Examples of com.subgraph.orchid.crypto.TorPublicKey

 
  boolean sendIntroduce(TorPublicKey permanentKey, byte[] publicKeyBytes, byte[] rendezvousCookie, Router rendezvousRouter) {
    final RelayCell introduceCell = introductionCircuit.createRelayCell(RelayCell.RELAY_COMMAND_INTRODUCE1, 0, introductionCircuit.getFinalCircuitNode());

    final byte[] payload = createIntroductionPayload(rendezvousRouter, publicKeyBytes, rendezvousCookie, permanentKey);
    final TorPublicKey serviceKey = introductionPoint.getServiceKey();
    introduceCell.putByteArray(serviceKey.getFingerprint().getRawBytes());
    introduceCell.putByteArray(payload);
    introductionCircuit.sendRelayCell(introduceCell);
   
    final RelayCell response = introductionCircuit.receiveRelayCell();
    if(response == null) {
View Full Code Here

Examples of com.subgraph.orchid.crypto.TorPublicKey

    currentCertificate.setDirectoryAddress(IPv4Address.createFromString(args[0]));
    currentCertificate.setDirectoryPort(fieldParser.parsePort(args[1]));
  }
 
  private void verifyCrossSignature(TorSignature crossSignature) {
    TorPublicKey identityKey = currentCertificate.getAuthorityIdentityKey();
    TorPublicKey signingKey = currentCertificate.getAuthoritySigningKey();
    if(!signingKey.verifySignature(crossSignature, identityKey.getFingerprint()))
      throw new TorParsingException("Cross signature on certificate failed.");
  }
View Full Code Here

Examples of com.subgraph.orchid.crypto.TorPublicKey

 
  protected void verifyIdentityKey(PublicKey publicKey) throws ConnectionHandshakeException {
    if(!(publicKey instanceof RSAPublicKey)) {
      throw new ConnectionHandshakeException("Identity certificate public key is not an RSA key as expected");
    }
    final TorPublicKey identityKey = new TorPublicKey((RSAPublicKey)publicKey);
    final Router router = connection.getRouter();
    if((router instanceof BridgeRouter) && (router.getIdentityHash() == null)) {
      logger.info("Setting Bridge fingerprint from connection handshake for "+ router);
      ((BridgeRouter) router).setIdentity(identityKey.getFingerprint());
    } else if(!identityKey.getFingerprint().equals(router.getIdentityHash())) {
      throw new ConnectionHandshakeException("Router identity does not match certificate key");
    }
  }
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.