All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class distinct.rpc.AuthDes

java.lang.Object
   |
   +----distinct.rpc.Auth
           |
           +----distinct.rpc.AuthDes

public class AuthDes
extends Auth
Implements AUTH_DES authenticators. Used in Secure RPC.

See Also:
Auth, AuthUnix, AuthShort

Variable Index

 o kMAXNETNAME

Constructor Index

 o AuthDes(String, BigInteger, BigInteger, int)
Creates an authenticator of flavor AUTH_DES.
 o AuthDes(String, String, String, PublicKeyDB, int)
Creates an authenticator of flavor AUTH_DES.

Method Index

 o generateKeyPair(String)
Generates a new key pair (public key/private key)
 o getClientNetname()
Returns the full authenticated netname of the client.
 o getSessionKey()
Returns the DES secret key that is used in this session.
 o getVerifier()
Returns the verifier that belongs to this authenticator.
 o setServerTime(int)
Sets the current system time of the server, measured in seconds, since midnight, January 1, 1970 UTC.
 o update()
Updates the authenticator for a new call with the latest timestamp.
 o validate(Auth)
Checks whether the other authenticator (the one returned from the server) fits to this one and updates the status of this instance if required.

Variables

 o kMAXNETNAME
 public static final int kMAXNETNAME

Constructors

 o AuthDes
 public AuthDes(String clientnetname,
                String passwd,
                String servernetname,
                PublicKeyDB db,
                int win) throws RPCError
Creates an authenticator of flavor AUTH_DES.

Parameters:
clientnetname - The name of the client's authority.
passwd - The password that authenticates the client's authority.
servernetname - The name of the servers's authority.
db - The key store.
win - The time window size in seconds.
Throws: RPCError
Thrown if creation fails.
 o AuthDes
 public AuthDes(String clientnetname,
                BigInteger SK,
                BigInteger PK,
                int win) throws RPCError
Creates an authenticator of flavor AUTH_DES.

Parameters:
clientnetname - The name of the client's authority.
SK - The secret private key of the client.
PK - The public key of the server.
win - The time window size in seconds.
Throws: RPCError
Thrown if creation fails.

Methods

 o setServerTime
 public void setServerTime(int server_time)
Sets the current system time of the server, measured in seconds, since midnight, January 1, 1970 UTC. Used for time synchronization between Secure RPC clients and servers. Typically only called by JRPC.ClientSecureRPC.

Parameters:
server_time - The current system time of the server.
 o getClientNetname
 public String getClientNetname()
Returns the full authenticated netname of the client.

Returns:
The netname of the client.
 o getSessionKey
 public SecretKey getSessionKey()
Returns the DES secret key that is used in this session. This is a secred shared only by the client and the server during this session. It can be used for encrypting additional parts of the RPC communication.

Returns:
The currently used DES secret key.
 o getVerifier
 public Auth getVerifier()
Returns the verifier that belongs to this authenticator. This verifier is updated automatically each time the update() or AuthDesServerDB.checkAuth() method of is called on this object.

Returns:
The verifier that belongs to this authenticator.
 o validate
 public void validate(Auth verf) throws RPCAuthError
Checks whether the other authenticator (the one returned from the server) fits to this one and updates the status of this instance if required. param auth The authenticator to be checked.

Throws: RPCAuthError
Thrown if the check fails.
 o update
 public void update() throws RPCError
Updates the authenticator for a new call with the latest timestamp. Usually only called by JRPC.ClientSecureRPC.

 o generateKeyPair
 public static String generateKeyPair(String passwd) throws RPCError
Generates a new key pair (public key/private key)

Parameters:
passwd - The password used to encrypt the secret key.
Returns:
A string that is ready for insertion into the "/etc/publickey" database (format "public_key:encrypted_private_key").
Throws: RPCError
Thrown if something fails in the crypto stuff.

All Packages  Class Hierarchy  This Package  Previous  Next  Index