com.sun.xml.wss.impl.policy.mls
Class AuthenticationTokenPolicy.UsernameTokenBinding

java.lang.Object
  extended by com.sun.xml.wss.impl.policy.MLSPolicy
      extended by com.sun.xml.wss.impl.policy.mls.WSSPolicy
          extended by com.sun.xml.wss.impl.policy.mls.AuthenticationTokenPolicy.UsernameTokenBinding
All Implemented Interfaces:
SecurityPolicy, java.lang.Cloneable
Enclosing class:
AuthenticationTokenPolicy

public static class AuthenticationTokenPolicy.UsernameTokenBinding
extends WSSPolicy

A policy representing a WSS UsernameToken. An instance of this class can be used as concrete feature binding for an AuthenticationTokenPolicy. Different parameters in this policy are applicable depending upon whether this policy is used to construct a wss:UsernameToken (sender side policy) or it is used to verify an incoming UsernameToken (receiver side policy). Information on applicability will be indicated where appropriate.


Constructor Summary
AuthenticationTokenPolicy.UsernameTokenBinding()
          Default Constructor
AuthenticationTokenPolicy.UsernameTokenBinding(java.lang.String username, java.lang.String password, java.lang.String nonce, boolean doDigest, java.lang.String creationTime)
          Constructor
 
Method Summary
 java.lang.Object clone()
          clone operatror
 boolean equals(WSSPolicy policy)
          Equals operator
 boolean equalsIgnoreTargets(WSSPolicy policy)
           
 boolean getDigestOn()
           
 long getMaxNonceAge()
           
 java.lang.String getNonce()
          get the nonce
 java.lang.String getPassword()
          get the password
 java.lang.String getType()
          Get the type of the policy.
 boolean getUseNonce()
          get the useNonce flag
 java.lang.String getUsername()
          get the username
 MLSPolicy newTimestampFeatureBinding()
          Create and set the FeatureBinding for this WSSPolicy to a TimestampPolicy * @return a new TimestampPolicy as a FeatureBinding for this WSSPolicy
 void setDigestOn(boolean doDigest)
          setter for a boolean flag indicating whether the password should be digested while constructing a wss:UsernameToken from this Policy
 void setMaxNonceAge(long nonceAge)
          set the maximum age in Milliseconds for which a receiving entity should cache the nonce associated with this policy.
 void setNonce(java.lang.String nonce)
          set the nonce
 void setPassword(java.lang.String password)
          set the password
 void setUseNonce(boolean useNonce)
          setter for a boolean flag indicating whether a nonce should be while constructing a wss:UsernameToken from this Policy
 void setUsername(java.lang.String username)
          set the username
 java.lang.String toString()
           
 
Methods inherited from class com.sun.xml.wss.impl.policy.mls.WSSPolicy
getFeatureBinding, getKeyBinding, getPolicyIdentifier, getUUID, isBSP, isBSP, isOptional, isOptional, setFeatureBinding, setKeyBinding, setPolicyIdentifier, setUUID
 
Methods inherited from class com.sun.xml.wss.impl.policy.MLSPolicy
isReadOnly, isReadOnly
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AuthenticationTokenPolicy.UsernameTokenBinding

public AuthenticationTokenPolicy.UsernameTokenBinding()
Default Constructor


AuthenticationTokenPolicy.UsernameTokenBinding

public AuthenticationTokenPolicy.UsernameTokenBinding(java.lang.String username,
                                                      java.lang.String password,
                                                      java.lang.String nonce,
                                                      boolean doDigest,
                                                      java.lang.String creationTime)
Constructor

Parameters:
username - username to be sent
password - password to be sent
nonce - nonce
doDigest - if password should be digested
creationTime - timestamp
Method Detail

newTimestampFeatureBinding

public MLSPolicy newTimestampFeatureBinding()
                                     throws PolicyGenerationException
Create and set the FeatureBinding for this WSSPolicy to a TimestampPolicy * @return a new TimestampPolicy as a FeatureBinding for this WSSPolicy

Throws:
PolicyGenerationException, - if TimestampPolicy is not a valid FeatureBinding for this WSSPolicy
PolicyGenerationException
See Also:
SignaturePolicy, EncryptionPolicy, AuthenticationTokenPolicy

setUsername

public void setUsername(java.lang.String username)
set the username

Parameters:
username -

setPassword

public void setPassword(java.lang.String password)
set the password

Parameters:
password -

setNonce

public void setNonce(java.lang.String nonce)
set the nonce

Parameters:
nonce -

setUseNonce

public void setUseNonce(boolean useNonce)
setter for a boolean flag indicating whether a nonce should be while constructing a wss:UsernameToken from this Policy

Parameters:
useNonce -

setDigestOn

public void setDigestOn(boolean doDigest)
setter for a boolean flag indicating whether the password should be digested while constructing a wss:UsernameToken from this Policy

Parameters:
doDigest -

setMaxNonceAge

public void setMaxNonceAge(long nonceAge)
set the maximum age in Milliseconds for which a receiving entity should cache the nonce associated with this policy. A receiver may cache received nonces for this period (or more) to minimize nonce-replay attacks This parameter is applicable when this UsernameToken is used as a Receiver requirement.

Parameters:
nonceAge -

getUsername

public java.lang.String getUsername()
get the username

Returns:
username

getPassword

public java.lang.String getPassword()
get the password

Returns:
password

getNonce

public java.lang.String getNonce()
get the nonce

Returns:
nonce

getUseNonce

public boolean getUseNonce()
get the useNonce flag

Returns:
true if the useNonce flag is set to true

getDigestOn

public boolean getDigestOn()
Returns:
if password is digested

getMaxNonceAge

public long getMaxNonceAge()
Returns:
the maxNonceAge

equals

public boolean equals(WSSPolicy policy)
Equals operator

Specified by:
equals in class WSSPolicy
Returns:
true if the binding is equal to this UsernameToken Policy
See Also:
SignaturePolicy, EncryptionPolicy, AuthenticationTokenPolicy, PrivateKeyBinding, SymmetricKeyBinding

equalsIgnoreTargets

public boolean equalsIgnoreTargets(WSSPolicy policy)
Specified by:
equalsIgnoreTargets in class WSSPolicy

clone

public java.lang.Object clone()
Description copied from class: WSSPolicy
clone operatror

Specified by:
clone in class WSSPolicy
Returns:
a clone of this policy
See Also:
SignaturePolicy, EncryptionPolicy, AuthenticationTokenPolicy

getType

public java.lang.String getType()
Description copied from interface: SecurityPolicy
Get the type of the policy.

Implementation Note: Useful to avoid instanceof checks and String.equals checks

Returns:
the type of the policy

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright ? 2005 Sun Microsystems, Inc. All Rights Reserved.