@Deprecated public class Connection extends Object
Modifier and Type | Field and Description |
---|---|
DataInputStream |
din
Deprecated.
|
DataOutputStream |
dout
Deprecated.
|
InputStream |
in
Deprecated.
|
OutputStream |
out
Deprecated.
|
Constructor and Description |
---|
Connection(InputStream in,
OutputStream out)
Deprecated.
|
Connection(Socket socket)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Deprecated.
|
KeyAgreement |
diffieHellman(boolean side)
Deprecated.
Performs a Diffie-Hellman key exchange and produce a common secret between two ends of the connection.
|
KeyAgreement |
diffieHellman(boolean side,
int keySize)
Deprecated.
|
Connection |
encryptConnection(SecretKey sessionKey,
String algorithm)
Deprecated.
Upgrades a connection with transport encryption by the specified symmetric cipher.
|
static byte[] |
fold(byte[] bytes,
int size)
Deprecated.
Given a byte array that contains arbitrary number of bytes, digests or expands those bits into the specified
number of bytes without loss of entropy.
|
void |
proveIdentity(byte[] sharedSecret,
KeyPair key)
Deprecated.
Used in conjunction with
verifyIdentity(byte[]) to prove
that we actually own the private key of the given key pair. |
boolean |
readBoolean()
Deprecated.
|
byte[] |
readByteArray()
Deprecated.
|
X509EncodedKeySpec |
readKey()
Deprecated.
|
<T> T |
readObject()
Deprecated.
Receives an object sent by
writeObject(Object) |
String |
readUTF()
Deprecated.
|
PublicKey |
verifyIdentity(byte[] sharedSecret)
Deprecated.
Verifies that we are talking to a peer that actually owns the private key corresponding to the public key we get.
|
void |
writeBoolean(boolean b)
Deprecated.
|
void |
writeByteArray(byte[] data)
Deprecated.
|
void |
writeKey(Key key)
Deprecated.
|
void |
writeObject(Object o)
Deprecated.
Sends a serializable object.
|
void |
writeUTF(String msg)
Deprecated.
|
public final InputStream in
public final OutputStream out
public final DataInputStream din
public final DataOutputStream dout
public Connection(Socket socket) throws IOException
IOException
public Connection(InputStream in, OutputStream out)
public void writeUTF(String msg) throws IOException
IOException
public String readUTF() throws IOException
IOException
public void writeBoolean(boolean b) throws IOException
IOException
public boolean readBoolean() throws IOException
IOException
public void writeObject(Object o) throws IOException
IOException
public <T> T readObject() throws IOException, ClassNotFoundException
writeObject(Object)
IOException
ClassNotFoundException
public void writeKey(Key key) throws IOException
IOException
public X509EncodedKeySpec readKey() throws IOException
IOException
public void writeByteArray(byte[] data) throws IOException
IOException
public byte[] readByteArray() throws IOException
IOException
public KeyAgreement diffieHellman(boolean side) throws IOException, GeneralSecurityException
DH is also useful as a coin-toss algorithm. Two parties get the same random number without trusting each other.
IOException
GeneralSecurityException
public KeyAgreement diffieHellman(boolean side, int keySize) throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
public Connection encryptConnection(SecretKey sessionKey, String algorithm) throws IOException, GeneralSecurityException
Connection
object that includes the transport encryption.IOException
GeneralSecurityException
public static byte[] fold(byte[] bytes, int size)
public void proveIdentity(byte[] sharedSecret, KeyPair key) throws IOException, GeneralSecurityException
verifyIdentity(byte[])
to prove
that we actually own the private key of the given key pair.IOException
GeneralSecurityException
public PublicKey verifyIdentity(byte[] sharedSecret) throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
public void close() throws IOException
IOException
Copyright © 2004–2022. All rights reserved.