Home » wss4j-src-1.5.7 » org.apache.ws.security » [javadoc | source]
org.apache.ws.security
public class: WSPasswordCallback [javadoc | source]
java.lang.Object
   org.apache.ws.security.WSPasswordCallback

All Implemented Interfaces:
    Callback

Simple class to provide a password callback mechanism.

It uses the JAAS authentication mechanisms and callback methods. In addition to the identifier (user name) this class also provides information what type of information the callback handle method shall provide.

The WSPasswordCallback class defines the following usage codes:

Field Summary
public static final  int UNKNOWN     
public static final  int DECRYPT     
public static final  int USERNAME_TOKEN     
public static final  int SIGNATURE     
public static final  int KEY_NAME     
public static final  int USERNAME_TOKEN_UNKNOWN     
public static final  int SECURITY_CONTEXT_TOKEN     
public static final  int CUSTOM_TOKEN     
public static final  int ENCRYPTED_KEY_TOKEN     
Constructor:
 public WSPasswordCallback(String id,
    int usage) 
    Constructor.
    Parameters:
    id - The application called back must supply the password for this identifier.
 public WSPasswordCallback(String id,
    String pw,
    String type,
    int usage) 
    Constructor.
    Parameters:
    id - The application called back must supply the password for this identifier.
Method from org.apache.ws.security.WSPasswordCallback Summary:
getCustomToken,   getIdentifer,   getIdentifier,   getKey,   getKeyType,   getPassword,   getPasswordType,   getUsage,   setCustomToken,   setIdentifier,   setKey,   setPassword
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.ws.security.WSPasswordCallback Detail:
 public Element getCustomToken() 
 public String getIdentifer() 
Deprecated! use - getIdentifier() instead

    Get the identifier.

 public String getIdentifier() 
    Get the identifier.

 public byte[] getKey() 
    Get the key.

 public String getKeyType() 
    The key type is only relevant for usage ENCRYPTED_KEY_TOKEN
 public String getPassword() 
    Get the password.

 public String getPasswordType() 
    The password type is only relevant for usage USERNAME_TOKEN and USERNAME_TOKEN_UNKNOWN.
 public int getUsage() 
    Get the usage.

 public  void setCustomToken(Element customToken) 
 public  void setIdentifier(String ident) 
    Extended callback interface allows for setting the username as well. Callback functions can change the identifier, this is intended in the usernametoken scenario where the usernametoken denotes the identity, but a fixed identity for signing is used The initial value is that from the configuration file. If this method is not called, the configured identity is used.
 public  void setKey(byte[] key) 
    Set the Key.

 public  void setPassword(String passwd) 
    Set the password.