com.threerings.presents.net
Class ServiceCreds

java.lang.Object
  extended by com.threerings.presents.net.Credentials
      extended by com.threerings.presents.net.ServiceCreds
All Implemented Interfaces:
Streamable
Direct Known Subclasses:
BureauCredentials, PeerCreds

public abstract class ServiceCreds
extends Credentials

Credentials used by service clients (peers, bureaus, etc.). A service would extend this class (so that their service clients can be identified by class name).


Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.presents.net.Credentials
Credentials.HasLanguage, Credentials.HasMachineIdent
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
Streamable.Closure
 
Field Summary
protected  String _authToken
          A token created by a call to createAuthToken(java.lang.String, java.lang.String).
 String clientId
          The id of the service client that is authenticating.
 
Constructor Summary
ServiceCreds()
          Used when unserializing an instance from the network.
ServiceCreds(String clientId, String sharedSecret)
          Creates credentials for the specified client.
 
Method Summary
 boolean areValid(String sharedSecret)
          Validates that these credentials were created with the supplied shared secret.
protected static String createAuthToken(String clientId, String sharedSecret)
          Creates a unique password for the specified node using the supplied shared secret.
 String toString()
           
 
Methods inherited from class com.threerings.presents.net.Credentials
getDatagramSecret
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

clientId

public String clientId
The id of the service client that is authenticating.


_authToken

protected String _authToken
A token created by a call to createAuthToken(java.lang.String, java.lang.String).

Constructor Detail

ServiceCreds

public ServiceCreds(String clientId,
                    String sharedSecret)
Creates credentials for the specified client.


ServiceCreds

public ServiceCreds()
Used when unserializing an instance from the network.

Method Detail

areValid

public boolean areValid(String sharedSecret)
Validates that these credentials were created with the supplied shared secret.


toString

public String toString()
Overrides:
toString in class Object

createAuthToken

protected static String createAuthToken(String clientId,
                                        String sharedSecret)
Creates a unique password for the specified node using the supplied shared secret.