com.ibm.as400.security.auth
Interface ProfileTokenImpl


public interface ProfileTokenImpl
extends com.ibm.as400.security.auth.AS400CredentialImpl

The ProfileTokenImpl interface provides the template for classes implementing behavior delegated by a ProfileTokenCredential.


Method Summary
 byte[] exchangeSeed(byte[] seed)
          Exchange a random seed with the caller.
 byte[] generateToken(java.lang.String uid, byte[] pwd, int type, int timeoutInterval)
          Generates and returns a new profile token based on the provided information.
 byte[] refresh(int type, int timeoutInterval)
          Updates or extends the validity period for the credential.
 
Methods inherited from interface com.ibm.as400.security.auth.AS400CredentialImpl
destroy, getTimeToExpiration, getVersion, isCurrent, refresh, setCredential, swap
 

Method Detail

exchangeSeed

public byte[] exchangeSeed(byte[] seed)
Exchange a random seed with the caller.
Parameters:
seed - The caller seed.
Returns:
The return seed.

generateToken

public byte[] generateToken(java.lang.String uid,
                            byte[] pwd,
                            int type,
                            int timeoutInterval)
                     throws RetrieveFailedException
Generates and returns a new profile token based on the provided information.
Parameters:
uid - The name of the user profile for which the token is to be generated.
pwd - The user profile password (encoded).
type - The type of token. Possible types are defined as fields on the ProfileTokenCredential class:
  • TYPE_SINGLE_USE
  • TYPE_MULTIPLE_USE_NON_RENEWABLE
  • TYPE_MULTIPLE_USE_RENEWABLE

timeoutInterval - The number of seconds to expiration.
Returns:
The token bytes.
Throws:
RetrieveFailedException - If errors occur while generating the token.

refresh

public byte[] refresh(int type,
                      int timeoutInterval)
               throws RefreshFailedException
Updates or extends the validity period for the credential.

Generates a new profile token based on the previously established token with the given type and timeoutInterval.

This method is provided to handle cases where it is desirable to allow for a more restrictive type of token or a different timeout interval when a new token is generated during the refresh.

Parameters:
type - The type of token. Possible types are defined as fields on this class:
  • TYPE_SINGLE_USE
  • TYPE_MULTIPLE_USE_NON_RENEWABLE
  • TYPE_MULTIPLE_USE_RENEWABLE

timeoutInterval - The number of seconds before expiration.
Returns:
The new token.
Throws:
RefreshFailedException - If errors occur during refresh.