|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectRvCommand
AbstractTrillianCryptRvCmd
A base class for the five Trillian Secure IM rendezvous commands provided in this package.
Field Summary | |
static int |
CMDTYPE_ACCEPT
A command type indicating that a command is accepting a secure conversation request. |
static int |
CMDTYPE_BEGIN
A command type indicating that an encrypted conversation has begun. |
static int |
CMDTYPE_CLOSE
A command type indicating that a command is closing a secure conversation. |
static int |
CMDTYPE_MESSAGE
A command type indicating that a command contains an encrypted message. |
static int |
CMDTYPE_REQUEST
A command type indicating that a command is a request for a secure conversation. |
static int |
VERSION_DEFAULT
The protocol version number used by Trillian. |
Fields inherited from class RvCommand |
RVSTATUS_ACCEPT, RVSTATUS_DENY, RVSTATUS_REQUEST |
Constructor Summary | |
protected |
AbstractTrillianCryptRvCmd(int cmdType)
Creates a new outgoing Trillian Encryption command with the given command type and a protocol version of VERSION_DEFAULT . |
protected |
AbstractTrillianCryptRvCmd(int encVersion,
int cmdType)
Creates a new outgoing Trillian Encryption command with the given command type and protocol version. |
protected |
AbstractTrillianCryptRvCmd(RecvRvIcbm icbm)
Creates a new Trillian Encryption command from the given incoming Trillian Encryption RV ICBM. |
Method Summary | |
protected static java.math.BigInteger |
getBigIntFromHexBlock(ByteBlock block)
Extracts a BigInteger from the given block of ASCII
hexadecimal digits. |
protected static byte[] |
getBigIntHexBlock(java.math.BigInteger num)
Returns a 33-byte block of data containing a 32-digit hexadecimal representation of the given number followed by a null byte ( 0x00 ). |
protected int |
getCmdType()
Returns the Trillian Encryption command type of this command. |
protected TlvChain |
getExtraTlvs()
Returns a list of extra TLV's sent in this command that were not parsed into fields like version and cmdType . |
static int |
getTrillianCmdType(RecvRvIcbm icbm)
Extracts the "command type" value from the given incoming Trillian Encryption RV ICBM. |
protected int |
getVersion()
Returns the protocol version being used. |
protected abstract void |
writeExtraTlvs(java.io.OutputStream out)
Writes any "extra" TLV's to be sent in this command to the given stream. |
void |
writeRvData(java.io.OutputStream out)
Writes this RV command's "rendezvous data block" to the given stream. |
Methods inherited from class RvCommand |
getCapabilityBlock, getRvStatus |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int VERSION_DEFAULT
public static final int CMDTYPE_REQUEST
public static final int CMDTYPE_ACCEPT
public static final int CMDTYPE_BEGIN
public static final int CMDTYPE_MESSAGE
public static final int CMDTYPE_CLOSE
Constructor Detail |
protected AbstractTrillianCryptRvCmd(RecvRvIcbm icbm)
icbm
- an incoming Trillian Encryption RV ICBMprotected AbstractTrillianCryptRvCmd(int cmdType)
VERSION_DEFAULT
.
cmdType
- a Trillian Encryption command type, like CMDTYPE_BEGIN
protected AbstractTrillianCryptRvCmd(int encVersion, int cmdType)
encVersion
- the Trillian Encryption protocol version being used
(normally VERSION_DEFAULT
)cmdType
- a Trillian Encryption command type, like CMDTYPE_BEGIN
Method Detail |
public static int getTrillianCmdType(RecvRvIcbm icbm)
-1
if the given
command does not contain a command type value.
icbm
- an incoming Trillian Encryption RV ICBM command
-1
if none is presentprotected static java.math.BigInteger getBigIntFromHexBlock(ByteBlock block)
BigInteger
from the given block of ASCII
hexadecimal digits.
block
- a block of data containing only ASCII hexadecimal digits
(that is, 0-9
and a-f
)
BigInteger
read from the given string of
hexadecimal digitsBigInteger.BigInteger(String, int)
protected static byte[] getBigIntHexBlock(java.math.BigInteger num) throws java.io.IOException, java.lang.IllegalArgumentException
0x00
).
num
- a number smaller than 2128
(that is,
a number whose hexadecimal representation is shorter than 33
digits)
java.io.IOException
- if the given number is too large to be represented
in 32 hexadecimal digits
java.lang.IllegalArgumentException
protected final int getVersion()
VERSION_DEFAULT
.
protected final int getCmdType()
protected final TlvChain getExtraTlvs()
version
and cmdType
.
public void writeRvData(java.io.OutputStream out) throws java.io.IOException
RvCommand
writeRvData
in class RvCommand
out
- the stream to which to write
java.io.IOException
- if an I/O error occursprotected abstract void writeExtraTlvs(java.io.OutputStream out) throws java.io.IOException
out
- the stream to which to write
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |