|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wss4j.common.ext.WSPasswordCallback
public class WSPasswordCallback
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 callbackhandle
method shall provide.
The WSPasswordCallback class defines the following usage
codes:
UNKNOWN - an unknown usage. Never used by the WSS4J
implementation and shall be treated as an error by the handle
method.DECRYPT - need a password to get the private key of
this identifier (username) from the keystore. WSS4J uses this private
key to decrypt the session (symmetric) key. Because the encryption
method uses the public key to encrypt the session key it needs no
password (a public key is usually not protected by a password).USERNAME_TOKEN - need the password to fill in or to
verify a UsernameToken.SIGNATURE - need the password to get the private key of
this identifier (username) from the keystore. WSS4J uses this private
key to produce a signature. The signature verification uses the public
key to verify the signature.SECURITY_CONTEXT_TOKEN - need the key to to be associated
with a wsc:SecurityContextToken.PASSWORD_ENCRYPTOR_PASSWORD - return the password used with a
PasswordEncryptor implementation to decrypt encrypted passwords stored in
Crypto properties files
| Field Summary | |
|---|---|
static int |
CUSTOM_TOKEN
CUSTOM_TOKEN usage is used for the case that we want the CallbackHandler to supply a token as a DOM Element. |
static int |
DECRYPT
DECRYPT usage is used when the calling code needs a password to get the private key of this identifier (alias) from a keystore. |
static int |
ENCRYPTED_KEY_TOKEN
Deprecated. |
static int |
KEY_NAME
Deprecated. |
static int |
PASSWORD_ENCRYPTOR_PASSWORD
PASSWORD_ENCRYPTOR_PASSWORD usage is used to return the password used with a PasswordEncryptor implementation to decrypt encrypted passwords stored in Crypto properties files |
static int |
SECRET_KEY
SECRET_KEY usage is used for the case that we want to obtain a secret key for encryption or signature on the outbound side, or for decryption or verification on the inbound side. |
static int |
SECURITY_CONTEXT_TOKEN
SECURITY_CONTEXT_TOKEN usage is for the case of when we want the CallbackHandler to supply the key associated with a SecurityContextToken. |
static int |
SIGNATURE
SIGNATURE usage is used on the outbound side only, to get a password to get the private key of this identifier (alias) from a keystore. |
static int |
UNKNOWN
An unknown usage. |
static int |
USERNAME_TOKEN
USERNAME_TOKEN usage is used to obtain a password for either creating a Username Token, or for validating it. |
static int |
USERNAME_TOKEN_UNKNOWN
Deprecated. |
| Constructor Summary | |
|---|---|
WSPasswordCallback(String id,
int usage)
Constructor. |
|
WSPasswordCallback(String id,
String pw,
String type,
int usage)
Constructor. |
|
| Method Summary | |
|---|---|
Element |
getCustomToken()
|
String |
getIdentifier()
Get the identifier. |
byte[] |
getKey()
Get the key. |
Key |
getKeyObject()
|
String |
getPassword()
Get the password. |
String |
getType()
|
int |
getUsage()
Get the usage. |
void |
setCustomToken(Element customToken)
Set the custom token |
void |
setIdentifier(String ident)
Set the identifier |
void |
setKey(byte[] secret)
Set the Key. |
void |
setKey(Key key)
|
void |
setPassword(String passwd)
Set the password. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int UNKNOWN
public static final int DECRYPT
public static final int USERNAME_TOKEN
public static final int SIGNATURE
@Deprecated public static final int KEY_NAME
@Deprecated public static final int USERNAME_TOKEN_UNKNOWN
public static final int SECURITY_CONTEXT_TOKEN
public static final int CUSTOM_TOKEN
@Deprecated public static final int ENCRYPTED_KEY_TOKEN
public static final int SECRET_KEY
public static final int PASSWORD_ENCRYPTOR_PASSWORD
| Constructor Detail |
|---|
public WSPasswordCallback(String id,
int usage)
id - The application called back must supply the password for
this identifier.
public WSPasswordCallback(String id,
String pw,
String type,
int usage)
id - The application called back must supply the password for
this identifier.| Method Detail |
|---|
public String getIdentifier()
public void setIdentifier(String ident)
ident - The identity.public void setPassword(String passwd)
passwd - is the password associated to the identifierpublic String getPassword()
public void setKey(byte[] secret)
secret - public void setKey(Key key)
public byte[] getKey()
public Key getKeyObject()
public int getUsage()
public String getType()
public Element getCustomToken()
public void setCustomToken(Element customToken)
customToken -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||