rice.p2p.multiring
Class RingCertificate

java.lang.Object
  extended by rice.p2p.multiring.RingCertificate
All Implemented Interfaces:
Serializable

public class RingCertificate
extends Object
implements Serializable

Version:
$Id: RingCertificate.java 4654 2009-01-08 16:33:07Z jeffh $
Author:
Alan Mislove
See Also:
Serialized Form

Field Summary
protected  InetSocketAddress[] bootstraps
           
protected static HashMap<Id,RingCertificate> CERTIFICATES
           
protected  Id id
           
protected  PublicKey key
           
protected  InetSocketAddress logServer
           
protected  String name
           
protected  Integer port
           
protected  Integer protocol
           
protected  byte[] signature
           
protected  Long version
           
 
Constructor Summary
RingCertificate(String name, Id id, int protocol, InetSocketAddress[] bootstraps, int port, PublicKey key, InetSocketAddress logServer)
          Builds a new RingCertificate given the appropriate info
 
Method Summary
 InetSocketAddress[] getBootstraps()
          Returns the bootstraps of this ring
static RingCertificate getCertificate(Id ringId)
          Method which returns the certificates found for the given ringId
 Id getId()
          Returns the id of this ring
 PublicKey getKey()
          Returns the public key which is used to authenticate
 InetSocketAddress getLogServer()
          Returns the log server of this ring
 String getName()
          Returns the name of this ring
 int getPort()
          Returns the preferred port of this ring
 int getProtocol()
          Returns the protcol of this ring
 long getVersion()
          Returns the version of this ring cert
static void main(String[] args)
          Main method which, as a utility, generates a RingCertificate by asking the user for prompts
static KeyPair readKeyPair(String ring, String pass)
          Internal method which writes out the keypair to a file, encrypted
 String toString()
          Returns a string of this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CERTIFICATES

protected static HashMap<Id,RingCertificate> CERTIFICATES

name

protected String name

id

protected Id id

protocol

protected Integer protocol

bootstraps

protected InetSocketAddress[] bootstraps

port

protected Integer port

logServer

protected InetSocketAddress logServer

key

protected PublicKey key

version

protected Long version

signature

protected byte[] signature
Constructor Detail

RingCertificate

public RingCertificate(String name,
                       Id id,
                       int protocol,
                       InetSocketAddress[] bootstraps,
                       int port,
                       PublicKey key,
                       InetSocketAddress logServer)
Builds a new RingCertificate given the appropriate info

Method Detail

getCertificate

public static RingCertificate getCertificate(Id ringId)
Method which returns the certificates found for the given ringId

Parameters:
ringId - The id
Returns:
All certificate

getName

public String getName()
Returns the name of this ring

Returns:
The name

getId

public Id getId()
Returns the id of this ring

Returns:
The id

getProtocol

public int getProtocol()
Returns the protcol of this ring

Returns:
The protocol

getVersion

public long getVersion()
Returns the version of this ring cert

Returns:
The version

getBootstraps

public InetSocketAddress[] getBootstraps()
Returns the bootstraps of this ring

Returns:
The bootstraps

getPort

public int getPort()
Returns the preferred port of this ring

Returns:
The preferred port

getKey

public PublicKey getKey()
Returns the public key which is used to authenticate

Returns:
The public key

getLogServer

public InetSocketAddress getLogServer()
Returns the log server of this ring

Returns:
The log server

toString

public String toString()
Returns a string of this object

Overrides:
toString in class Object
Returns:
a string

readKeyPair

public static KeyPair readKeyPair(String ring,
                                  String pass)
                           throws IOException,
                                  ClassNotFoundException
Internal method which writes out the keypair to a file, encrypted

Parameters:
pass - THe password
ring - The ring name
Throws:
IOException
ClassNotFoundException

main

public static void main(String[] args)
                 throws Exception
Main method which, as a utility, generates a RingCertificate by asking the user for prompts

Throws:
Exception


Copyright © 2010. All Rights Reserved.