|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.tumbler.TumblerKnock
A java implementation of the TUMBLER1 protocol (see Tumbler on SourceForge). The TumblerKnock class allows for the building and transmission of tumbler knocks using the TUMBLER1 protocol. To send TUMBLER2 knocks, see the TumblerKnockV2 class in this package.
Sending a knock consists of three steps:send()
method
TumblerKnock knock = new TumblerKnock();
knock.setSourceAddress(InetAddress.getByName("1.2.3.4"));
knock.setSecret("pAsSwOrD");
knock.send(InetAddress.getByName("4.5.6.7"), 8765);
Method Summary | |
static void |
main(java.lang.String[] args)
Insanely simple and almost completely non-robust test/example program that sends a TUMBLER1 knock. |
void |
send(java.net.InetAddress dest,
int port)
Sends the knock to the specified recipient. |
void |
setSecret(java.lang.String secret)
Sets the "secret" (e.g., password) portion of the knock. |
void |
setSourceAddress(java.net.InetAddress src)
Sets the source IP address to embed within the knock. |
void |
setTimestamp(java.util.Date timestamp)
Sets the timestamp (to minute resolution) to embed within the knock. |
java.lang.String |
toString()
Returns a String representation of the knock request, consisting of the protocol declaration and the hashed knock data. |
java.lang.String |
toUnhashedString()
Returns the unhashed knock data, without the protocol declaration. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public final java.lang.String toString()
public java.lang.String toUnhashedString()
public void setSecret(java.lang.String secret)
secret
- the secret to embed within the knockpublic void setSourceAddress(java.net.InetAddress src)
src
- the source IP address of the knock from the receiver's
point of viewpublic void setTimestamp(java.util.Date timestamp)
timestamp
- the timestamp to embed within the knockpublic void send(java.net.InetAddress dest, int port) throws java.net.SocketException, java.io.UnsupportedEncodingException, java.io.IOException
dest
- the IP address to knockport
- the port # to knock
java.net.SocketException
- if a socket error occurs
java.io.UnsupportedEncodingException
- if US-ASCII is for some
reason unavailable as an encoding
java.io.IOException
- if anything else goes wrongpublic static void main(java.lang.String[] args) throws java.lang.Exception
Insanely simple and almost completely non-robust test/example program that sends a TUMBLER1 knock.
Invoke with no arguments for usage information.
java.lang.Exception
- if anything at all goes wrong.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |