All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class distinct.rpc.PublicKeyDB

java.lang.Object
   |
   +----distinct.rpc.PublicKeyDB

public class PublicKeyDB
extends Object
Key database for Secure RPC.


Constructor Index

 o PublicKeyDB(File)
Creates a new secure RPC key database and initializes it from a local file.
 o PublicKeyDB(URL)
Creates a new secure RPC key database and initializes it from an URL.

Method Index

 o doLogin(boolean)
Opens the default login dialog on the screen and waits for user's imput.
 o doLogin(String, int, int, boolean)
Opens a login dialog on the screen and waits for user's imput.
 o getFirstName()
Method for enumerating the stored name.
 o getNetname()
Returns the netname entered during the most recent invocation of doLogin().
 o getNextName()
Method for enumerating the stored name.
 o getPassword()
Returns the password entered during the most recent invocation of doLogin().
 o getPublicKey(String)
Returns the public key of an authority.
 o getSecretKey(String)
Returns the encrypted private key of an authority.

Constructors

 o PublicKeyDB
 public PublicKeyDB(File file) throws IOException
Creates a new secure RPC key database and initializes it from a local file. The file must have the format of the UNIX "/etc/publickey" file (one entry per line, line format "usernetname:public_key:encrypted_private_key").

Parameters:
file - The file that is used fo initilization.
Throws: IOException
Thrown if the file cannot be read.
 o PublicKeyDB
 public PublicKeyDB(URL url) throws IOException
Creates a new secure RPC key database and initializes it from an URL. The content of the URL must have the format of the UNIX "publickey" file (one entry per line, line format "usernetname:public_key:encrypted_private_key").

Parameters:
url - The URL that is used fo initilization.
Throws: IOException
Thrown if the URL is unreachable.

Methods

 o getPublicKey
 public String getPublicKey(String name) throws RPCError
Returns the public key of an authority.

Parameters:
name - The name of the authority.
Returns:
The stored public key of the requested authority in hex notation.
Throws: RPCError
Thrown if the key is not found in the database.
 o getSecretKey
 public String getSecretKey(String name) throws RPCError
Returns the encrypted private key of an authority.

Parameters:
name - The name of the authority.
Returns:
The stored encrypted private key of the requested authority in hex notation.
Throws: RPCError
Thrown if the key is not found in the database.
 o getFirstName
 public String getFirstName()
Method for enumerating the stored name. Returns the first stored name. Use getNextName to retrieve the subsequent entries.

Returns:
The first stored name. Null if no names are stored.
 o getNextName
 public String getNextName()
Method for enumerating the stored name. Returns the next stored name. Use getFirstName to initialize an enumeration.

Returns:
The next stored name. Null if no further names are stored.
 o doLogin
 public boolean doLogin(boolean free)
Opens the default login dialog on the screen and waits for user's imput.

Parameters:
free - If true, the user has to enter the netname as free text, If false, the user may select the netname from a choice of all known names.
Returns:
True if the user closed the dialog with "OK" or the "Enter" Key, otherwise False.
 o doLogin
 public boolean doLogin(String title,
                        int x,
                        int y,
                        boolean free)
Opens a login dialog on the screen and waits for user's imput.

Parameters:
title - The title of the dialog.
x - The x coordinate of the dialog.
y - The y coordinate of the dialog.
free - If true, the user has to enter the netname as free text, If false, the user may select the netname from a choice of all known names.
Returns:
True if the user closed the dialog with "OK" or the "Enter" Key, otherwise False.
 o getNetname
 public String getNetname()
Returns the netname entered during the most recent invocation of doLogin().

Returns:
The netname.
 o getPassword
 public String getPassword()
Returns the password entered during the most recent invocation of doLogin().

Returns:
The password.

All Packages  Class Hierarchy  This Package  Previous  Next  Index