com.distinct.rpc
Class PublicKeyDBYP

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

public class PublicKeyDBYP
extends PublicKeyDB

Connection to a NIS (Yellow Pages) publickey database for secure RPC keys.


Constructor Summary
PublicKeyDBYP(java.lang.String domainname)
          Creates an object that is connected to a NIS publickey database.
PublicKeyDBYP(java.lang.String domainname, java.lang.String servername)
          Creates an object that is connected to a NIS publickey database.
 
Method Summary
 java.lang.String getFirstName()
          Method for enumerating the stored name.
 java.lang.String getNextName()
          Method for enumerating the stored name.
 java.lang.String getPublicKey(java.lang.String name)
          Returns the public key of an authority.
 java.lang.String getSecretKey(java.lang.String name)
          Returns the encrypted private key of an authority.
 
Methods inherited from class com.distinct.rpc.PublicKeyDB
doLogin, doLogin, getNetname, getPassword
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PublicKeyDBYP

public PublicKeyDBYP(java.lang.String domainname)
              throws RPCError
Creates an object that is connected to a NIS publickey database. It assumes that a ypbind server is running on the executing machine.

Parameters:
domainname - The name of the domain.
Throws:
RPCError - Thrown if something fails while connecting to the NIS.

PublicKeyDBYP

public PublicKeyDBYP(java.lang.String domainname,
                     java.lang.String servername)
              throws RPCError
Creates an object that is connected to a NIS publickey database. Use this constructor if you do not run on a machine that has a local ypbind process running (usually a non-Unix) machine.

Parameters:
domainname - The name of the domain.
servername - The name of a machine that runs a ypbind server (Probably the server you want to connect to).
Throws:
RPCError - Thrown if something fails while connecting to the NIS.
Method Detail

getPublicKey

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

Overrides:
getPublicKey in class PublicKeyDB
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 java.lang.String getSecretKey(java.lang.String name)
                              throws RPCError
Returns the encrypted private key of an authority.

Overrides:
getSecretKey in class PublicKeyDB
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 java.lang.String getFirstName()
Method for enumerating the stored name. Returns the first stored name. Use getNextName to retrieve the subsequent entries.

Overrides:
getFirstName in class PublicKeyDB
Returns:
The first stored name. Null if no names are stored.

getNextName

public java.lang.String getNextName()
Method for enumerating the stored name. Returns the next stored name. Use getFirstName to initialize an enumeration.

Overrides:
getNextName in class PublicKeyDB
Returns:
The next stored name. Null if no further names are stored.