|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--hypercast.SecInfoExchange_Message
This class defines the format for security information exchange messages, including key request, ket reply, certificate request and certificate reply. It also provides a wrap message for plaintext protocol messages so that they can be exchanged between different overlay nodes when security policy (privacy or integrity) is applied. The format of a SecInfoExchange_Message instance in byte array format is: ----------------------------------------------------------------------------- |Proto number|Payload Length | Type | Sequence Num | OverlayID hash | | 8 bits | 16 bits | 8 bits | 32 bits | 32 bits | ----------------------------------------------------------------------------- | Src Addr Pair / Dest Addr Pair / | LA size+PA size / LA size+PA size / ------------------------------------- (only for a wrap message, i.e. type is ProtoMsg) ---------------------------------------------------------------------- /Payload Mac Len/ Payload MacType / Sender key timestamp / / 16 bits / variable / 64 bits / -------------------------------------------------------------- (except key request message) ------------------- / Payload / / / ------------------- The payload is a certificate for certificate request or reply message, a key timestamp and key for key update message, or the byte array of plaintext protocol message for a ProtoMsg message.
Field Summary | |
static byte |
CertReply
|
static byte |
CertRequest
Constants for the type of a SecInfoExchange_Message instance. |
static byte |
KeyRequest
|
static byte |
KeyUpdate
|
static byte |
ProtoMsg
|
static byte |
PROTONUM_SIE30
Protocol Number value in Protocol field for SecInfoExchange message |
Constructor Summary | |
SecInfoExchange_Message(byte[] A,
int[] beginValidBytes,
hypercast.I_UnicastAdapter adapter,
hypercast.SecurityProcessor sp)
Constructor. |
|
SecInfoExchange_Message(int type,
int gh,
hypercast.I_AddressPair _src,
hypercast.I_AddressPair _dst,
hypercast.SecurityProcessor sp)
Constructor. |
Method Summary | |
java.security.cert.X509Certificate |
getCertificate()
Get the certificate stored in this object. |
javax.crypto.spec.SecretKeySpec |
getKey()
Get the key stored in this object. |
long |
getKeyTimestamp()
Get the creation time of the key in the KeyUpdate or ProtoMsg message |
int |
getOverlayHash()
Get the overlay ID hash value carried in this object. |
int |
getPayloadLength()
Get the length of the payload |
hypercast.I_Message |
getProtoMsg()
Get the plaintext protocol message stored in this object. |
byte[] |
getProtoMsgBytes()
Get the byte array converted from the plaintext protocol message stored in this object. |
int |
getSequenceNum()
|
hypercast.I_AddressPair |
getSrc()
Get the source address pair of this message. |
byte |
getType()
Query the type of this SecInfoExchange_Message instance. |
static hypercast.SecInfoExchange_Message |
restoreMessage(byte[] A,
int[] beginValidBytes,
int endValidBytes,
hypercast.I_UnicastAdapter adapter,
int thisOverlayHash,
hypercast.SecurityProcessor sp)
Re-construct a SecInfoExchange_Message instance from byte array. |
void |
setCertificate(java.security.cert.X509Certificate _cert)
Set the certificate variable. |
void |
setKey(javax.crypto.spec.SecretKeySpec _key)
Set the key variable. |
void |
setKeyTimestamp(long timestamp)
Set the creation time for the sender's key |
void |
setProtoMsg(hypercast.I_Message _protoMsg)
Set the plaintext protocol message stored in this object. |
void |
setProtoMsgBytes(byte[] msgBytes)
Set the byte array converted from the plaintext protocol message stored in this object. |
void |
setSequenceNum(int sequenceNum)
|
byte[] |
toByteArray()
Converts this object to byte array. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final byte CertRequest
public static final byte CertReply
public static final byte KeyRequest
public static final byte KeyUpdate
public static final byte ProtoMsg
public static final byte PROTONUM_SIE30
Constructor Detail |
public SecInfoExchange_Message(int type, int gh, hypercast.I_AddressPair _src, hypercast.I_AddressPair _dst, hypercast.SecurityProcessor sp)
type
- type of this message.gh
- overlay ID hash value._src
- source address of this message._dst
- destination address of this message.sp
- security processor which handles secure message sending/
receiving issues in this overlay socket.public SecInfoExchange_Message(byte[] A, int[] beginValidBytes, hypercast.I_UnicastAdapter adapter, hypercast.SecurityProcessor sp)
A
- packet, i.e., a SecInfoExchange_Message message in byte array format.beginValidBytes
- start point for reading available data in the packet.adapter
- node adapter.sp
- security processor.Method Detail |
public static hypercast.SecInfoExchange_Message restoreMessage(byte[] A, int[] beginValidBytes, int endValidBytes, hypercast.I_UnicastAdapter adapter, int thisOverlayHash, hypercast.SecurityProcessor sp)
A
- packet, i.e., a SecInfoExchange_Message message in byte array format.beginValidBytes
- start point for reading available data in the packet.endValidBytes
- end point of available data in the packet.adapter
- node adapter.thisOverlayHash
- overlay ID hash.
java.lang.IllegalArgumentException
- when an error occurs in creating or
decoding security parameterspublic byte[] toByteArray()
toByteArray
in interface I_Message
I_Message.toByteArray()
public byte getType()
public hypercast.I_AddressPair getSrc()
public int getOverlayHash()
public java.security.cert.X509Certificate getCertificate()
public void setCertificate(java.security.cert.X509Certificate _cert)
_cert
- a certificate instance.public javax.crypto.spec.SecretKeySpec getKey()
public void setKey(javax.crypto.spec.SecretKeySpec _key)
_key
- a key instance.public hypercast.I_Message getProtoMsg()
public void setProtoMsg(hypercast.I_Message _protoMsg)
_protoMsg
- a plaintext protocol message.public void setProtoMsgBytes(byte[] msgBytes)
msgBytes
- the byte array of plaintext protocol message.public byte[] getProtoMsgBytes()
public int getPayloadLength()
public void setKeyTimestamp(long timestamp)
timestamp
- the creation time of the keypublic long getKeyTimestamp()
public java.lang.String toString()
toString
in class java.lang.Object
public int getSequenceNum()
public void setSequenceNum(int sequenceNum)
sequenceNum
- The sequenceNum to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |