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
-
kMAXNETNAME
-
-
AuthDes(String, BigInteger, BigInteger, int)
- Creates an authenticator of flavor AUTH_DES.
-
AuthDes(String, String, String, PublicKeyDB, int)
- Creates an authenticator of flavor AUTH_DES.
-
generateKeyPair(String)
- Generates a new key pair (public key/private key)
-
getClientNetname()
- Returns the full authenticated netname of the client.
-
getSessionKey()
- Returns the DES secret key that is used in this session.
-
getVerifier()
- Returns the verifier that belongs to this authenticator.
-
setServerTime(int)
- Sets the current system time of the server, measured in seconds, since midnight,
January 1, 1970 UTC.
-
update()
- Updates the authenticator for a new call with the latest timestamp.
-
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.
kMAXNETNAME
public static final int kMAXNETNAME
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.
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.
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.
getClientNetname
public String getClientNetname()
- Returns the full authenticated netname of the client.
- Returns:
- The netname of the client.
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.
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.
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.
update
public void update() throws RPCError
- Updates the authenticator for a new call with the latest timestamp.
Usually only called by JRPC.ClientSecureRPC.
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