|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthudson.cli.Connection
public class Connection
| Field Summary | |
|---|---|
DataInputStream |
din
|
DataOutputStream |
dout
|
InputStream |
in
|
OutputStream |
out
|
| Constructor Summary | |
|---|---|
Connection(InputStream in,
OutputStream out)
|
|
Connection(Socket socket)
|
|
| Method Summary | ||
|---|---|---|
void |
close()
|
|
KeyAgreement |
diffieHellman(boolean side)
Performs a Diffie-Hellman key exchange and produce a common secret between two ends of the connection. |
|
void |
proveIdentity(byte[] sharedSecret,
KeyPair key)
Used in conjunction with verifyIdentity(byte[]) to prove
that we actually own the private key of the given key pair. |
|
boolean |
readBoolean()
|
|
X509EncodedKeySpec |
readKey()
|
|
|
readObject()
Receives an object sent by writeObject(Object) |
|
String |
readUTF()
|
|
PublicKey |
verifyIdentity(byte[] sharedSecret)
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)
|
|
void |
writeKey(Key key)
|
|
void |
writeObject(Object o)
Sends a serializable object. |
|
void |
writeUTF(String msg)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final InputStream in
public final OutputStream out
public final DataInputStream din
public final DataOutputStream dout
| Constructor Detail |
|---|
public Connection(Socket socket)
throws IOException
IOException
public Connection(InputStream in,
OutputStream out)
| Method Detail |
|---|
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 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 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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||