org.apache.ws.security
Class WSSConfig

java.lang.Object
  extended byorg.apache.ws.security.WSSConfig

public class WSSConfig
extends java.lang.Object

WSSConfig

Carries configuration data so the WSS4J spec compliance can be modified in runtime. Configure an instance of this object only if you need WSS4J to emulate certain industry clients or previous OASIS specifications for WS-Security interoperability testing purposes.

The default settings follow the latest OASIS and changing anything might violate the OASIS specs.

WARNING: changing the default settings will break the compliance with the latest specs. Do this only if you know what you are doing.

Author:
Rami Jaamour (rjaamour@parasoft.com)

Field Summary
protected static WSSConfig defaultConfig
           
protected  boolean prefixBSTValues
           
protected  boolean processNonCompliantMessages
           
protected  boolean qualifyBSTAttributes
           
protected  boolean targetIdQualified
           
static int TIMESTAMP_IN_HEADER_ELEMENT
           
static int TIMESTAMP_IN_SECURITY_ELEMENT
           
protected  int timestampLocation
           
protected  boolean wsiBSPCompliant
           
protected  java.lang.String wsse_ns
           
protected  java.lang.String wsu_ns
           
 
Constructor Summary
protected WSSConfig()
           
 
Method Summary
static WSSConfig getDefaultWSConfig()
          returns a static WSConfig instance that is configured with the latest OASIS WS-Seurity settings.
static WSSConfig getNewInstance()
           
 boolean getProcessNonCompliantMessages()
          default value is true.
 int getTimestampLocation()
          default value is TIMESTAMP_IN_SECURITY_ELEMENT (following OASIS 2003 and 2004 specs).
 java.lang.String getWsseNS()
          default value is WSConstants.WSSE_NS_OASIS_1_0

The WS-Security namespace

 java.lang.String getWsuNS()
          default value is WSConstants.WSU_NS_OASIS_1_0

The WS-Security utility namespace

 boolean isBSTAttributesQualified()
          default value is false.
 boolean isBSTValuesPrefixed()
          default value is false.
 boolean isTargetIdQualified()
          default value is true.
 boolean isWsiBSPCompliant()
          Checks if we are in WS-I Basic Security Profile compliance mode
 void setBSTAttributesQualified(boolean qualifyBSTAttributes)
          specify if the BinarySecurityToken EncodingType and ValueType attributes should be namespace qualified.
 void setBSTValuesPrefixed(boolean prefixBSTAttributeValues)
          sets and option whether the BinarySecurityToken EncodingType and ValueType attribute values should be prefixed with "wsse" or otherwise qualified with the wsse namespace (false).
 void setProcessNonCompliantMessages(boolean attemptProcess)
          Sets an option whether WSS4J should attempt to process non-compliant WS-Security messages, such as WS-Security headers with older OASIS spec namespaces.
 void setTargetIdQualified(boolean qualifyTargetIdAttribute)
          Sets an option whether the Id attribute placed in the signature target should be qualified with the wsu namespace.
 void setTimestampLocation(int timestampElementLocation)
          Sets an option whether the Iwsu:Timestamp element is placed inside the wsse:Secutriy element.
 void setWsiBSPCompliant(boolean wsiBSPCompliant)
          Set the WS-I Basic Security Profile compliance mode.
 void setWsseNS(java.lang.String wsseNamespace)
          Valid values: WSConstants.WSSE_NS_OASIS_2002_07 WSConstants.WSSE_NS_OASIS_2002_12 WSConstants.WSSE_NS_OASIS_2003_06 WSConstants.WSSE_NS_OASIS_1_0 OASIS WS-Security v1.0 (March 2004).
 void setWsuNS(java.lang.String wsuNamespace)
          Valid values: WSConstants.WSU_NS_OASIS_2002_07 WSConstants.WSU_NS_OASIS_2002_12 WSConstants.WSU_NS_OASIS_2003_06 WSConstants.WSU_NS_OASIS_1_0 OASIS WS-Security v1.0 (March 2004).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultConfig

protected static WSSConfig defaultConfig

wsse_ns

protected java.lang.String wsse_ns

wsu_ns

protected java.lang.String wsu_ns

qualifyBSTAttributes

protected boolean qualifyBSTAttributes

prefixBSTValues

protected boolean prefixBSTValues

targetIdQualified

protected boolean targetIdQualified

wsiBSPCompliant

protected boolean wsiBSPCompliant

processNonCompliantMessages

protected boolean processNonCompliantMessages

TIMESTAMP_IN_SECURITY_ELEMENT

public static final int TIMESTAMP_IN_SECURITY_ELEMENT
See Also:
Constant Field Values

TIMESTAMP_IN_HEADER_ELEMENT

public static final int TIMESTAMP_IN_HEADER_ELEMENT
See Also:
Constant Field Values

timestampLocation

protected int timestampLocation
Constructor Detail

WSSConfig

protected WSSConfig()
Method Detail

getNewInstance

public static WSSConfig getNewInstance()
Returns:
a new WSSConfig instance configured with the default values (values identical to getDefaultWSConfig())

getDefaultWSConfig

public static WSSConfig getDefaultWSConfig()
returns a static WSConfig instance that is configured with the latest OASIS WS-Seurity settings.


getWsseNS

public java.lang.String getWsseNS()
default value is WSConstants.WSSE_NS_OASIS_1_0

The WS-Security namespace


setWsseNS

public void setWsseNS(java.lang.String wsseNamespace)
Valid values:


getWsuNS

public java.lang.String getWsuNS()
default value is WSConstants.WSU_NS_OASIS_1_0

The WS-Security utility namespace


setWsuNS

public void setWsuNS(java.lang.String wsuNamespace)
Valid values:


isBSTAttributesQualified

public boolean isBSTAttributesQualified()
default value is false.

returns true if the BinarySecurityToken EncodingType and ValueType attributes should be namespace qualified.


setBSTAttributesQualified

public void setBSTAttributesQualified(boolean qualifyBSTAttributes)
specify if the BinarySecurityToken EncodingType and ValueType attributes should be namespace qualified. The default value is false.


isBSTValuesPrefixed

public boolean isBSTValuesPrefixed()
default value is false.

returns true if the BinarySecurityToken EncodingType and ValueType attribute values should be prefixed with "wsse" or otherwise qualified with the wsse namespace (false).


setBSTValuesPrefixed

public void setBSTValuesPrefixed(boolean prefixBSTAttributeValues)
sets and option whether the BinarySecurityToken EncodingType and ValueType attribute values should be prefixed with "wsse" or otherwise qualified with the wsse namespace (false).


isTargetIdQualified

public boolean isTargetIdQualified()
default value is true.

returns true if the Id attribute placed in the signature target element is qualified with the wsu namespace.


setTargetIdQualified

public void setTargetIdQualified(boolean qualifyTargetIdAttribute)
Sets an option whether the Id attribute placed in the signature target should be qualified with the wsu namespace.


getTimestampLocation

public int getTimestampLocation()
default value is TIMESTAMP_IN_SECURITY_ELEMENT (following OASIS 2003 and 2004 specs).

returns TIMESTAMP_IN_SECURITY_ELEMENT if the wsu:Timestamp element is placed inside the wsse:Secutriy element. TIMESTAMP_IN_HEADER_ELEMENT if it is placed under the Header directly, outside the wsse:Secutriy element.


setTimestampLocation

public void setTimestampLocation(int timestampElementLocation)
Sets an option whether the Iwsu:Timestamp element is placed inside the wsse:Secutriy element. set it to false foe placement in the Header, outside the wsse:Secutriy element.


getProcessNonCompliantMessages

public boolean getProcessNonCompliantMessages()
default value is true.

returns true if WSS4J attempts to process non-compliant WS-Security messages, such as WS-Security headers with older OASIS spec namespaces.


setProcessNonCompliantMessages

public void setProcessNonCompliantMessages(boolean attemptProcess)
Sets an option whether WSS4J should attempt to process non-compliant WS-Security messages, such as WS-Security headers with older OASIS spec namespaces.


isWsiBSPCompliant

public boolean isWsiBSPCompliant()
Checks if we are in WS-I Basic Security Profile compliance mode

Returns:

setWsiBSPCompliant

public void setWsiBSPCompliant(boolean wsiBSPCompliant)
Set the WS-I Basic Security Profile compliance mode. The default is false (dues to .Net interop problems).

Parameters:
wsiBSPCompliant -