j_waste.network
Class InitialPacket1

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

public class InitialPacket1
extends Packet

This class represents the InitialPacket1 used during authentication.

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

Field Summary
 
Fields inherited from class j_waste.network.Packet
packet
 
Constructor Summary
InitialPacket1(byte[] input)
          Constructs a new InitialPacket1 from the input array.
InitialPacket1(byte[] sRand, byte[] sPubKeyHash)
          Constructs a new InitialPacket1.
 
Method Summary
 void finalizePacket()
          Finalizes the packet.
static int getSize()
          Returns the size of this packet.
 byte[] getSPubKeyHash()
          Returns the public key hash from 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

InitialPacket1

public InitialPacket1(byte[] sRand,
                      byte[] sPubKeyHash)
Constructs a new InitialPacket1.

Parameters:
sRand - 16 random bytes used during authentication.
sPubKeyHash - The hash of this nodes public RSA key.

InitialPacket1

public InitialPacket1(byte[] input)
Constructs a new InitialPacket1 from the input array.

Parameters:
input - The array from which the packet will constructed.
Method Detail

getSRand

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

Returns:
the sRand of this packet.

getSPubKeyHash

public byte[] getSPubKeyHash()
Returns the public key hash from this packet.

Returns:
the public key hash from this packet.

getSize

public static int getSize()
Returns the size of this packet.

Returns:
the size of this InitialPacket1.

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 the packet.

Specified by:
finalizePacket in class Packet