com.threerings.presents.net
Class PublicKeyCredentials

java.lang.Object
  extended by com.threerings.presents.net.Credentials
      extended by com.threerings.presents.net.PublicKeyCredentials
All Implemented Interfaces:
Streamable

public class PublicKeyCredentials
extends Credentials

Credentials based on a public key encrypted secret.


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  byte[] _encodedSecret
          Our transmitted key.
protected  byte[] _salt
          Our verification salt.
protected  byte[] _secret
          Our secret key.
protected  int _secureVersion
          Our secure version.
 
Constructor Summary
PublicKeyCredentials()
          No-arg constructor.
PublicKeyCredentials(PublicKey key)
          Create a public key credential.
 
Method Summary
 String getDatagramSecret()
          Returns a string to use in a hash on the datagram contents to authenticate client datagrams.
 byte[] getSecret()
          Returns the secret.
 byte[] getSecret(PrivateKey key)
          Decodes the secret.
 int getSecureVersion()
          Returns the secure version the client is using.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_encodedSecret

protected byte[] _encodedSecret
Our transmitted key.


_salt

protected byte[] _salt
Our verification salt.


_secureVersion

protected int _secureVersion
Our secure version.


_secret

protected transient byte[] _secret
Our secret key.

Constructor Detail

PublicKeyCredentials

public PublicKeyCredentials()
No-arg constructor.


PublicKeyCredentials

public PublicKeyCredentials(PublicKey key)
Create a public key credential.

Method Detail

getSecureVersion

public int getSecureVersion()
Returns the secure version the client is using.


getSecret

public byte[] getSecret()
Returns the secret.


getSecret

public byte[] getSecret(PrivateKey key)
Decodes the secret.


getDatagramSecret

public String getDatagramSecret()
Description copied from class: Credentials
Returns a string to use in a hash on the datagram contents to authenticate client datagrams.

Overrides:
getDatagramSecret in class Credentials