com.threerings.presents.net
Class SecureResponse

java.lang.Object
  extended by com.threerings.io.SimpleStreamableObject
      extended by com.threerings.presents.net.Message
          extended by com.threerings.presents.net.DownstreamMessage
              extended by com.threerings.presents.net.AuthResponse
                  extended by com.threerings.presents.net.SecureResponse
All Implemented Interfaces:
Streamable, AuthCodes

public class SecureResponse
extends AuthResponse
implements AuthCodes

Used to indicate a authentication response based on a SecureRequest.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
Streamable.Closure
 
Field Summary
 
Fields inherited from class com.threerings.presents.net.AuthResponse
_data, authdata
 
Fields inherited from class com.threerings.presents.net.DownstreamMessage
messageId
 
Fields inherited from class com.threerings.presents.net.Message
received
 
Fields inherited from interface com.threerings.presents.data.AuthCodes
FAILED_TO_SECURE, INVALID_PASSWORD, NO_SUCH_USER, SERVER_ERROR, SERVER_UNAVAILABLE, TRYING_NEXT_PORT
 
Constructor Summary
SecureResponse()
          Zero argument constructor used when unserializing an instance.
SecureResponse(String code)
          Creates a secure response with the response code.
 
Method Summary
 byte[] createSecret(PublicKeyCredentials pkcred, PrivateKey key, int length)
          Encodes the server secret in the response data, or sets the failed state.
 byte[] getCodeBytes(PublicKeyCredentials pkcreds)
          Returns the code bytes or null for a failed state.
 
Methods inherited from class com.threerings.presents.net.AuthResponse
getData, setData, toString
 
Methods inherited from class com.threerings.presents.net.Message
getTransport, noteActualTransport, setTransport
 
Methods inherited from class com.threerings.io.SimpleStreamableObject
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SecureResponse

public SecureResponse()
Zero argument constructor used when unserializing an instance.


SecureResponse

public SecureResponse(String code)
Creates a secure response with the response code.

Method Detail

createSecret

public byte[] createSecret(PublicKeyCredentials pkcred,
                           PrivateKey key,
                           int length)
Encodes the server secret in the response data, or sets the failed state.

Returns:
the server secret if successfully encoded, or null.

getCodeBytes

public byte[] getCodeBytes(PublicKeyCredentials pkcreds)
Returns the code bytes or null for a failed state.