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.
-
PublicKeyDB(File)
- Creates a new secure RPC key database and initializes it
from a local file.
-
PublicKeyDB(URL)
- Creates a new secure RPC key database and initializes it
from an URL.
-
doLogin(boolean)
- Opens the default login dialog on the screen and waits for user's imput.
-
doLogin(String, int, int, boolean)
- Opens a login dialog on the screen and waits for user's imput.
-
getFirstName()
- Method for enumerating the stored name.
-
getNetname()
- Returns the netname entered during the most recent invocation of doLogin().
-
getNextName()
- Method for enumerating the stored name.
-
getPassword()
- Returns the password entered during the most recent invocation of doLogin().
-
getPublicKey(String)
- Returns the public key of an authority.
-
getSecretKey(String)
- Returns the encrypted private key of an authority.
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.
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.
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.
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.
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.
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.
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.
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.
getNetname
public String getNetname()
- Returns the netname entered during the most recent invocation of doLogin().
- Returns:
- The netname.
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