use of org.teiid.net.socket.Handshake in project teiid by teiid.
the class SocketClientInstance method onConnection.
public void onConnection() throws CommunicationException {
Handshake handshake = new Handshake();
handshake.setAuthType(csr.getAuthenticationType());
if (usingEncryption) {
keyGen = new DhKeyGenerator();
byte[] publicKey;
try {
handshake.setPublicKeyLarge(keyGen.createPublicKey(true));
} catch (CryptoException e) {
// not supported on this platform
}
try {
publicKey = keyGen.createPublicKey(false);
} catch (CryptoException e) {
throw new CommunicationException(RuntimePlugin.Event.TEIID40051, e);
}
handshake.setPublicKey(publicKey);
}
this.objectSocket.write(handshake);
}
Aggregations