anon.tor.ordescription
Class ORDescriptor

java.lang.Object
  extended by anon.tor.ordescription.ORDescriptor

public class ORDescriptor
extends java.lang.Object


Field Summary
private  java.util.Vector family
           
private  ORAcl m_acl
           
private  java.lang.String m_address
           
private  boolean m_bIsExitNode
           
private  java.lang.String m_fingerprint
           
private  java.lang.String m_hash
           
private  boolean m_hibernate
           
private  java.lang.String m_name
           
private  MyRSAPublicKey m_onionkey
           
private  int m_port
           
private  int m_portDir
           
private  java.lang.String m_published
           
private  MyRSAPublicKey m_signingkey
           
private  java.lang.String m_strSoftware
           
private  int m_uptime
           
 
Constructor Summary
ORDescriptor(java.lang.String address, java.lang.String name, int port, java.lang.String strSoftware)
          Constructor
 
Method Summary
private static java.lang.String calcHash(java.lang.String desc)
           
private static boolean checkSignature(byte[] document, byte[] signature, byte[] identity)
           
 ORAcl getAcl()
          gets the ACL for this onion router
 java.lang.String getAddress()
          gets the address of the OR
 int getDirPort()
          gets the port of the directory server
 java.util.Vector getFamily()
           
 java.lang.String getFingerprint()
           
 java.lang.String getHash()
           
 boolean getHibernate()
           
 java.lang.String getName()
          gets the name of the OR
 MyRSAPublicKey getOnionKey()
          gets the onionkey
 int getPort()
          gets the port
 java.lang.String getPublished()
           
 MyRSAPublicKey getSigningKey()
          gets the signing key
 java.lang.String getSoftware()
          gets the software version of this OR
 int getUptime()
           
 boolean isExitNode()
          returns if this server is an exit node
 boolean isSimilar(java.lang.Object onionrouter)
          test if two OR's are identical returns also true, if the routers are in the same family
static ORDescriptor parse(java.io.LineNumberReader reader)
          Tries to parse an router specification according to the descriptor.
 void setAcl(ORAcl acl)
          sets the ACL for this onion router
 void setDirPort(int port)
          sets the port of the directory server
 void setExitNode(boolean bIsExitNode)
          sets this server as exit node or not
 void setFamily(java.util.Vector fam)
           
 void setFingerprint(java.lang.String fp)
           
 void setHash(java.lang.String hash)
           
 void setHibernate(boolean hibernate)
           
 boolean setOnionKey(byte[] onionkey)
          sets the onionkey for this OR
 void setPublished(java.lang.String published)
           
 boolean setSigningKey(byte[] signingkey)
          sets the signing key
 void setUptime(int uptime)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_address

private java.lang.String m_address

m_name

private java.lang.String m_name

m_fingerprint

private java.lang.String m_fingerprint

m_hibernate

private boolean m_hibernate

m_port

private int m_port

m_portDir

private int m_portDir

m_uptime

private int m_uptime

m_strSoftware

private java.lang.String m_strSoftware

m_published

private java.lang.String m_published

m_hash

private java.lang.String m_hash

m_acl

private ORAcl m_acl

m_bIsExitNode

private boolean m_bIsExitNode

m_onionkey

private MyRSAPublicKey m_onionkey

m_signingkey

private MyRSAPublicKey m_signingkey

family

private java.util.Vector family
Constructor Detail

ORDescriptor

public ORDescriptor(java.lang.String address,
                    java.lang.String name,
                    int port,
                    java.lang.String strSoftware)
Constructor

Parameters:
address - address of the onion router
name - name for the onion router
port - port
strSoftware - version of the onion router software
Method Detail

setPublished

public void setPublished(java.lang.String published)

getPublished

public java.lang.String getPublished()

setFingerprint

public void setFingerprint(java.lang.String fp)

getFingerprint

public java.lang.String getFingerprint()

setHash

public void setHash(java.lang.String hash)

getHash

public java.lang.String getHash()

setUptime

public void setUptime(int uptime)

getUptime

public int getUptime()

getFamily

public java.util.Vector getFamily()

setHibernate

public void setHibernate(boolean hibernate)

getHibernate

public boolean getHibernate()

setExitNode

public void setExitNode(boolean bIsExitNode)
sets this server as exit node or not

Parameters:
bIsExitNode -

setFamily

public void setFamily(java.util.Vector fam)

isExitNode

public boolean isExitNode()
returns if this server is an exit node

Returns:

setAcl

public void setAcl(ORAcl acl)
sets the ACL for this onion router

Parameters:
acl - ACL

getAcl

public ORAcl getAcl()
gets the ACL for this onion router

Returns:
ACL

setOnionKey

public boolean setOnionKey(byte[] onionkey)
sets the onionkey for this OR

Parameters:
onionkey - onionkey
Returns:
true if the key is a rsa key

getOnionKey

public MyRSAPublicKey getOnionKey()
gets the onionkey

Returns:
onionkey

setSigningKey

public boolean setSigningKey(byte[] signingkey)
sets the signing key

Parameters:
signingkey - signing key
Returns:
true if the key is a RSA key

getSigningKey

public MyRSAPublicKey getSigningKey()
gets the signing key

Returns:
signing key

getAddress

public java.lang.String getAddress()
gets the address of the OR

Returns:
address

getName

public java.lang.String getName()
gets the name of the OR

Returns:
name

setDirPort

public void setDirPort(int port)
sets the port of the directory server

Parameters:
port - port

getPort

public int getPort()
gets the port

Returns:
port

getDirPort

public int getDirPort()
gets the port of the directory server

Returns:
port

getSoftware

public java.lang.String getSoftware()
gets the software version of this OR

Returns:
software version

isSimilar

public boolean isSimilar(java.lang.Object onionrouter)
test if two OR's are identical returns also true, if the routers are in the same family

Parameters:
or - OR
Returns:

parse

public static ORDescriptor parse(java.io.LineNumberReader reader)
Tries to parse an router specification according to the descriptor.

Parameters:
reader - reader
Returns:
parsed descriptor (or null on error)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

calcHash

private static java.lang.String calcHash(java.lang.String desc)

checkSignature

private static boolean checkSignature(byte[] document,
                                      byte[] signature,
                                      byte[] identity)