org.torproject.jtor.hiddenservice
Class ServiceDescriptor

java.lang.Object
  extended by org.torproject.jtor.hiddenservice.ServiceDescriptor

public class ServiceDescriptor
extends java.lang.Object

The Class ServiceDescriptor.


Constructor Summary
ServiceDescriptor(byte[] permanentID)
          Instantiates a new service descriptor.
 
Method Summary
 void encodeDescriptor()
          Encode descriptor.
 void generateDescriptorID()
          Generate descriptor id.
static byte[] generatePermanentID(org.torproject.jtor.crypto.TorPublicKey publicKey)
          Generate permanent id.
 void generateTimePeriod()
          Generate time period.
 byte[] getDescriptor()
          Gets the descriptor.
 byte[] getDescriptorCookie()
          Gets the descriptor cookie.
 byte[] getDescriptorData()
          Gets the descriptor data.
 byte[] getDescriptorID()
          Gets the descriptor id.
 java.lang.String getDescriptorString()
          Gets the descriptor string.
 byte[] getPermanentID()
          Gets the permanent id.
 java.lang.String getPublicationTime()
          Gets the publication time.
 int getReplica()
          Gets the replica.
 long getTimePeriod()
          Gets the time period.
 boolean hasDescriptorCookie()
          Checks for descriptor cookie.
 void setDescriptorCookie(byte[] descriptorCookie)
          Sets the descriptor cookie.
 void setPermanentID(byte[] permenantID)
          Sets the permanent id.
 void setReplica(int replica)
          Sets the replica.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceDescriptor

public ServiceDescriptor(byte[] permanentID)
Instantiates a new service descriptor.

Parameters:
permanentID - the permanent id
Method Detail

hasDescriptorCookie

public boolean hasDescriptorCookie()
Checks for descriptor cookie.

Returns:
true, if successful

generateDescriptorID

public void generateDescriptorID()
Generate descriptor id.


generateTimePeriod

public void generateTimePeriod()
Generate time period.


generatePermanentID

public static byte[] generatePermanentID(org.torproject.jtor.crypto.TorPublicKey publicKey)
Generate permanent id.

Parameters:
publicKey - the public key
Returns:
the byte[]

encodeDescriptor

public void encodeDescriptor()
Encode descriptor.


getPublicationTime

public java.lang.String getPublicationTime()
Gets the publication time.

Returns:
the publication time

getReplica

public int getReplica()
Gets the replica.

Returns:
the replica

getTimePeriod

public long getTimePeriod()
Gets the time period.

Returns:
the time period

getDescriptorString

public java.lang.String getDescriptorString()
Gets the descriptor string.

Returns:
the descriptor string

getDescriptor

public byte[] getDescriptor()
Gets the descriptor.

Returns:
the descriptor

getPermanentID

public byte[] getPermanentID()
Gets the permanent id.

Returns:
the permanent id

getDescriptorCookie

public byte[] getDescriptorCookie()
Gets the descriptor cookie.

Returns:
the descriptor cookie

setReplica

public void setReplica(int replica)
Sets the replica.

Parameters:
replica - the new replica

setPermanentID

public void setPermanentID(byte[] permenantID)
Sets the permanent id.

Parameters:
permenantID - the new permanent id

setDescriptorCookie

public void setDescriptorCookie(byte[] descriptorCookie)
Sets the descriptor cookie.

Parameters:
descriptorCookie - the new descriptor cookie

getDescriptorData

public byte[] getDescriptorData()
Gets the descriptor data.

Returns:
the descriptor data

getDescriptorID

public byte[] getDescriptorID()
Gets the descriptor id.

Returns:
the descriptor id