j_waste.network
Class InitialPacket2PSK

java.lang.Object
  extended byj_waste.network.Packet
      extended byj_waste.network.InitialPacket2PSK

public class InitialPacket2PSK
extends Packet

This class represents the InitialPacket2PSK used during authentication. This packet is used when the nodes authenticate using a pre-shared key.

Version:
0.2
Author:
Fredrik Hultin (frehul@users.sourceforge.net)

Field Summary
 
Fields inherited from class j_waste.network.Packet
packet
 
Constructor Summary
InitialPacket2PSK(byte[] sPubCrypted, byte[] sRand)
          Constructs a new InitialPacket2SPK.
 
Method Summary
 void finalizePacket()
          Finalizes this packet.
 byte[] getSPubCrypted()
          Returns the sPubCrypted of this packet.
 byte[] getSRand()
          Returns the sRand of this packet.
 byte[] toByteArray()
          Returns a byte array representation of the packet.
 
Methods inherited from class j_waste.network.Packet
padCD, reverseBytes, reverseInt, reverseShort, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InitialPacket2PSK

public InitialPacket2PSK(byte[] sPubCrypted,
                         byte[] sRand)
Constructs a new InitialPacket2SPK.

Parameters:
sPubCrypted - The sPubCrypted of this packet. 512 bytes.
sRand - 16 random bytes used during authentication.
Method Detail

getSPubCrypted

public byte[] getSPubCrypted()
Returns the sPubCrypted of this packet.

Returns:
the sPubCrypted of this packet.

getSRand

public byte[] getSRand()
Returns the sRand of this packet.

Returns:
the sRand of this packet.

toByteArray

public byte[] toByteArray()
Returns a byte array representation of the packet.

Specified by:
toByteArray in class Packet
Returns:
a byte array representation of the packet.

finalizePacket

public void finalizePacket()
Finalizes this packet.

Specified by:
finalizePacket in class Packet