com.yosokumo.core
Class Credentials

java.lang.Object
  extended by com.yosokumo.core.Credentials

public class Credentials
extends java.lang.Object

Specifies credentials (user id and key) for Yosokumo authentication.


Field Summary
private  byte[] key
          The key belonging to the user.
static int KEY_LEN
          The exact length of a key.
private  java.lang.String userId
          The user to whom the key belongs.
 
Constructor Summary
Credentials(java.lang.String userId, byte[] key)
          Initializes a newly created Credentials object to the user id and key given as parameters.
 
Method Summary
 byte[] getKey()
          Return a copy of the user key.
 java.lang.String getUserId()
          Return the user id.
static java.lang.String keyToString(byte[] key)
          Return a string representation of a key.
 java.lang.String toString()
          Return a string representation of the Credentials.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY_LEN

public static final int KEY_LEN
The exact length of a key.

See Also:
Constant Field Values

userId

private java.lang.String userId
The user to whom the key belongs.


key

private byte[] key
The key belonging to the user.

Constructor Detail

Credentials

public Credentials(java.lang.String userId,
                   byte[] key)
            throws ServiceException
Initializes a newly created Credentials object to the user id and key given as parameters.

Throws:
ServiceException - if the key length is not correct.
Method Detail

getUserId

public java.lang.String getUserId()
Return the user id.

Returns:
the user id.

getKey

public byte[] getKey()
Return a copy of the user key.

Returns:
a copy of the user key.

toString

public java.lang.String toString()
Return a string representation of the Credentials.

Overrides:
toString in class java.lang.Object
Returns:
the string representation of the Credentials.

keyToString

public static java.lang.String keyToString(byte[] key)
Return a string representation of a key.

Parameters:
key - the key to convert to a string.
Returns:
the string representation of key.