org.apache.cxf.ws.security.wss4j
Class WSS4JUtils

java.lang.Object
  extended by org.apache.cxf.ws.security.wss4j.WSS4JUtils

public final class WSS4JUtils
extends Object

Some common functionality that can be shared between the WSS4JInInterceptor and the UsernameTokenInterceptor.


Field Summary
static String FAILED_AUTHENTICATION_ERR
           
static String FAILED_CHECK_ERR
           
static String INVALID_SECURITY_ERR
           
static String INVALID_SECURITY_TOKEN_ERR
           
static String MESSAGE_EXPIRED_ERR
           
static String SECURITY_TOKEN_UNAVAILABLE_ERR
           
static String UNSUPPORTED_ALGORITHM_ERR
           
static String UNSUPPORTED_TOKEN_ERR
           
 
Method Summary
static List<org.apache.ws.security.WSSecurityEngineResult> fetchAllActionResults(List<org.apache.ws.security.WSSecurityEngineResult> resultList, int action)
          Fetch the result of a given action from a given result list.
static List<org.apache.ws.security.WSSecurityEngineResult> fetchAllActionResults(List<org.apache.ws.security.WSSecurityEngineResult> resultList, List<Integer> actions)
          Fetch the results of a given number of actions action from a given result list.
static org.apache.ws.security.cache.ReplayCache getReplayCache(org.apache.cxf.binding.soap.SoapMessage message, String booleanKey, String instanceKey)
          Get a ReplayCache instance.
static String getSafeExceptionMessage(org.apache.ws.security.WSSecurityException ex)
          Map a WSSecurityException FaultCode to a standard error String, so as not to leak internal configuration to an attacker.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNSUPPORTED_TOKEN_ERR

public static final String UNSUPPORTED_TOKEN_ERR
See Also:
Constant Field Values

UNSUPPORTED_ALGORITHM_ERR

public static final String UNSUPPORTED_ALGORITHM_ERR
See Also:
Constant Field Values

INVALID_SECURITY_ERR

public static final String INVALID_SECURITY_ERR
See Also:
Constant Field Values

INVALID_SECURITY_TOKEN_ERR

public static final String INVALID_SECURITY_TOKEN_ERR
See Also:
Constant Field Values

FAILED_AUTHENTICATION_ERR

public static final String FAILED_AUTHENTICATION_ERR
See Also:
Constant Field Values

FAILED_CHECK_ERR

public static final String FAILED_CHECK_ERR
See Also:
Constant Field Values

SECURITY_TOKEN_UNAVAILABLE_ERR

public static final String SECURITY_TOKEN_UNAVAILABLE_ERR
See Also:
Constant Field Values

MESSAGE_EXPIRED_ERR

public static final String MESSAGE_EXPIRED_ERR
See Also:
Constant Field Values
Method Detail

getReplayCache

public static org.apache.ws.security.cache.ReplayCache getReplayCache(org.apache.cxf.binding.soap.SoapMessage message,
                                                                      String booleanKey,
                                                                      String instanceKey)
Get a ReplayCache instance. It first checks to see whether caching has been explicitly enabled or disabled via the booleanKey argument. If it has been set to false then no replay caching is done (for this booleanKey). If it has not been specified, then caching is enabled only if we are not the initiator of the exchange. If it has been specified, then caching is enabled. It tries to get an instance of ReplayCache via the instanceKey argument from a contextual property, and failing that the message exchange. If it can't find any, then it defaults to using an EH-Cache instance and stores that on the message exchange.


fetchAllActionResults

public static List<org.apache.ws.security.WSSecurityEngineResult> fetchAllActionResults(List<org.apache.ws.security.WSSecurityEngineResult> resultList,
                                                                                        int action)
Fetch the result of a given action from a given result list.

Parameters:
resultList - The result list to fetch an action from
action - The action to fetch
Returns:
The result fetched from the result list, null if the result could not be found

fetchAllActionResults

public static List<org.apache.ws.security.WSSecurityEngineResult> fetchAllActionResults(List<org.apache.ws.security.WSSecurityEngineResult> resultList,
                                                                                        List<Integer> actions)
Fetch the results of a given number of actions action from a given result list.

Parameters:
resultList - The result list to fetch an action from
actions - The list of actions to fetch
Returns:
The list of matching results fetched from the result list

getSafeExceptionMessage

public static String getSafeExceptionMessage(org.apache.ws.security.WSSecurityException ex)
Map a WSSecurityException FaultCode to a standard error String, so as not to leak internal configuration to an attacker.



Apache CXF