Package org.spout.vanilla.protocol.msg.auth

Examples of org.spout.vanilla.protocol.msg.auth.EncryptionKeyRequestMessage


      AsymmetricCipherKeyPair keys = SecurityHandler.getInstance().getKeyPair(keySize, keyAlgorithm);
      byte[] randombyte = new byte[4];
      random.nextBytes(randombyte);
      session.getDataMap().put("verifytoken", randombyte);
      byte[] secret = SecurityHandler.getInstance().encodeKey(keys.getPublic());
      session.send(Session.SendType.FORCE, new EncryptionKeyRequestMessage(sessionId, false, secret, randombyte));
    } else {
      session.disconnect("Handshake already exchanged.");
    }
  }
View Full Code Here


    byte[] publicKey = new byte[length];
    buffer.readBytes(publicKey);
    int tokenLength = buffer.readShort() & 0xFFFF;
    byte[] token = new byte[tokenLength];
    buffer.readBytes(token);
    return new EncryptionKeyRequestMessage(sessionId, false, publicKey, token);
  }
View Full Code Here

TOP

Related Classes of org.spout.vanilla.protocol.msg.auth.EncryptionKeyRequestMessage

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.