org.apache.wss4j.dom
Class WSSConfig

java.lang.Object
  extended by org.apache.wss4j.dom.WSSConfig

public class WSSConfig
extends 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.


Field Summary
static DatatypeFactory datatypeFactory
           
static WsuIdAllocator DEFAULT_ID_ALLOCATOR
           
protected  WsuIdAllocator idAllocator
           
 
Method Summary
 Action getAction(int action)
          Lookup action
 boolean getAllowNamespaceQualifiedPasswordTypes()
           
 WSTimeSource getCurrentTime()
           
 boolean getHandleCustomPasswordTypes()
           
 WsuIdAllocator getIdAllocator()
           
static WSSConfig getNewInstance()
           
 boolean getPasswordsAreEncoded()
           
 Processor getProcessor(QName el)
           
 String getRequiredPasswordType()
           
 int getTimeStampFutureTTL()
           
 int getTimeStampTTL()
           
 int getUtFutureTTL()
           
 int getUtTTL()
           
 Validator getValidator(QName el)
           
static void init()
           
 boolean isAddInclusivePrefixes()
          Whether to add an InclusiveNamespaces PrefixList as a CanonicalizationMethod child when generating Signatures using WSConstants.C14N_EXCL_OMIT_COMMENTS.
 boolean isAllowUsernameTokenNoPassword()
           
 boolean isEnableSignatureConfirmation()
           
 boolean isPrecisionInMilliSeconds()
          Checks if we need to use milliseconds in timestamps
 boolean isTimeStampStrict()
           
 boolean isValidateSamlSubjectConfirmation()
           
 Class<?> setAction(int code, Action action)
          Associate an action instance with a specific action code.
 Class<?> setAction(int code, Class<?> clazz)
          Associate an action instance with a specific action code.
 void setAddInclusivePrefixes(boolean addInclusivePrefixes)
          Whether to add an InclusiveNamespaces PrefixList as a CanonicalizationMethod child when generating Signatures using WSConstants.C14N_EXCL_OMIT_COMMENTS.
 void setAllowNamespaceQualifiedPasswordTypes(boolean allowNamespaceQualifiedTypes)
           
 void setAllowUsernameTokenNoPassword(boolean allowUsernameTokenNoPassword)
           
 void setCurrentTime(WSTimeSource currentTime)
           
 void setEnableSignatureConfirmation(boolean enableSignatureConfirmation)
           
 void setHandleCustomPasswordTypes(boolean handleCustomTypes)
           
 void setIdAllocator(WsuIdAllocator idAllocator)
           
 void setPasswordsAreEncoded(boolean passwordsAreEncoded)
           
 void setPrecisionInMilliSeconds(boolean precisionInMilliSeconds)
          Set the precision in milliseconds for timestamps
 Class<?> setProcessor(QName el, Class<?> clazz)
          Associate a SOAP processor name with a specified SOAP Security header element QName.
 Class<?> setProcessor(QName el, Processor processor)
          Associate a SOAP processor name with a specified SOAP Security header element QName.
 void setRequiredPasswordType(String requiredPasswordType)
           
 void setTimeStampFutureTTL(int timeStampFutureTTL)
           
 void setTimeStampStrict(boolean timeStampStrict)
           
 void setTimeStampTTL(int timeStampTTL)
           
 void setUtFutureTTL(int utFutureTTL)
           
 void setUtTTL(int utTTL)
           
 void setValidateSamlSubjectConfirmation(boolean validateSamlSubjectConfirmation)
           
 Class<?> setValidator(QName el, Class<?> clazz)
          Associate a SOAP validator name with a specified SOAP Security header element QName.
 Class<?> setValidator(QName el, Validator validator)
          Associate a SOAP validator name with a specified SOAP Security header element QName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

datatypeFactory

public static final DatatypeFactory datatypeFactory

DEFAULT_ID_ALLOCATOR

public static final WsuIdAllocator DEFAULT_ID_ALLOCATOR

idAllocator

protected WsuIdAllocator idAllocator
Method Detail

init

public static void init()

getNewInstance

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

isPrecisionInMilliSeconds

public boolean isPrecisionInMilliSeconds()
Checks if we need to use milliseconds in timestamps

Returns:
whether to use precision in milliseconds for timestamps

setPrecisionInMilliSeconds

public void setPrecisionInMilliSeconds(boolean precisionInMilliSeconds)
Set the precision in milliseconds for timestamps

Parameters:
precisionInMilliSeconds - whether to use precision in milliseconds for timestamps

isEnableSignatureConfirmation

public boolean isEnableSignatureConfirmation()
Returns:
Returns the enableSignatureConfirmation.

setEnableSignatureConfirmation

public void setEnableSignatureConfirmation(boolean enableSignatureConfirmation)
Parameters:
enableSignatureConfirmation - The enableSignatureConfirmation to set.

setHandleCustomPasswordTypes

public void setHandleCustomPasswordTypes(boolean handleCustomTypes)
Parameters:
handleCustomTypes - whether to handle custom UsernameToken password types or not

getHandleCustomPasswordTypes

public boolean getHandleCustomPasswordTypes()
Returns:
whether custom UsernameToken password types are allowed or not

setAllowNamespaceQualifiedPasswordTypes

public void setAllowNamespaceQualifiedPasswordTypes(boolean allowNamespaceQualifiedTypes)
Parameters:
allowNamespaceQualifiedTypes - whether (wsse) namespace qualified password types are accepted or not

getAllowNamespaceQualifiedPasswordTypes

public boolean getAllowNamespaceQualifiedPasswordTypes()
Returns:
whether (wsse) namespace qualified password types are accepted or not

isTimeStampStrict

public boolean isTimeStampStrict()
Returns:
Returns if we shall throw an exception on expired request semantic

setTimeStampStrict

public void setTimeStampStrict(boolean timeStampStrict)
Parameters:
timeStampStrict - If true throw an exception on expired request semantic

getRequiredPasswordType

public String getRequiredPasswordType()
Returns:
the required password type when processing a UsernameToken

setRequiredPasswordType

public void setRequiredPasswordType(String requiredPasswordType)
Parameters:
requiredPasswordType - The required password type when processing a Username Token.

getTimeStampTTL

public int getTimeStampTTL()
Returns:
Returns the TTL of a Timestamp in seconds

setTimeStampTTL

public void setTimeStampTTL(int timeStampTTL)
Parameters:
timeStampTTL - The new value for timeStampTTL

getTimeStampFutureTTL

public int getTimeStampFutureTTL()
Returns:
Returns the Future TTL of a Timestamp in seconds

setTimeStampFutureTTL

public void setTimeStampFutureTTL(int timeStampFutureTTL)
Parameters:
timeStampFutureTTL - the new value for timeStampFutureTTL

setPasswordsAreEncoded

public void setPasswordsAreEncoded(boolean passwordsAreEncoded)
Parameters:
passwordsAreEncoded - whether passwords are encoded

getPasswordsAreEncoded

public boolean getPasswordsAreEncoded()
Returns:
whether passwords are encoded

getIdAllocator

public WsuIdAllocator getIdAllocator()
Returns:
Returns the WsuIdAllocator used to generate wsu:Id attributes

setIdAllocator

public void setIdAllocator(WsuIdAllocator idAllocator)

setAction

public Class<?> setAction(int code,
                          Action action)
Associate an action instance with a specific action code. This operation allows applications to supply their own actions for well-known operations. Please note that the Action object does NOT get class-loaded per invocation, and so it is up to the implementing class to ensure that it is thread-safe.


setAction

public Class<?> setAction(int code,
                          Class<?> clazz)
Associate an action instance with a specific action code. This operation allows applications to supply their own actions for well-known operations.


getAction

public Action getAction(int action)
                 throws WSSecurityException
Lookup action

Parameters:
action -
Returns:
An action class to create a security token
Throws:
WSSecurityException

setProcessor

public Class<?> setProcessor(QName el,
                             Processor processor)
Associate a SOAP processor name with a specified SOAP Security header element QName. Processors registered under this QName will be called when processing header elements with the specified type. Please note that the Processor object does NOT get class-loaded per invocation, and so it is up to the implementing class to ensure that it is thread-safe.


setProcessor

public Class<?> setProcessor(QName el,
                             Class<?> clazz)
Associate a SOAP processor name with a specified SOAP Security header element QName. Processors registered under this QName will be called when processing header elements with the specified type.


setValidator

public Class<?> setValidator(QName el,
                             Validator validator)
Associate a SOAP validator name with a specified SOAP Security header element QName. Validators registered under this QName will be called when processing header elements with the specified type. Please note that the Validator object does NOT get class-loaded per invocation, and so it is up to the implementing class to ensure that it is thread-safe.


setValidator

public Class<?> setValidator(QName el,
                             Class<?> clazz)
Associate a SOAP validator name with a specified SOAP Security header element QName. validator registered under this QName will be called when processing header elements with the specified type.


getValidator

public Validator getValidator(QName el)
                       throws WSSecurityException
Returns:
the SOAP Validator associated with the specified QName. The QName is intended to refer to an element in a SOAP security header. This operation returns null if there is no Validator associated with the specified QName.
Throws:
WSSecurityException

getProcessor

public Processor getProcessor(QName el)
                       throws WSSecurityException
Returns:
the SOAP processor associated with the specified QName. The QName is intended to refer to an element in a SOAP security header. This operation returns null if there is no processor associated with the specified QName.
Throws:
WSSecurityException

isAddInclusivePrefixes

public boolean isAddInclusivePrefixes()
Whether to add an InclusiveNamespaces PrefixList as a CanonicalizationMethod child when generating Signatures using WSConstants.C14N_EXCL_OMIT_COMMENTS. The default is true.


setAddInclusivePrefixes

public void setAddInclusivePrefixes(boolean addInclusivePrefixes)
Whether to add an InclusiveNamespaces PrefixList as a CanonicalizationMethod child when generating Signatures using WSConstants.C14N_EXCL_OMIT_COMMENTS. The default is true.


isAllowUsernameTokenNoPassword

public boolean isAllowUsernameTokenNoPassword()

setAllowUsernameTokenNoPassword

public void setAllowUsernameTokenNoPassword(boolean allowUsernameTokenNoPassword)

getUtTTL

public int getUtTTL()

setUtTTL

public void setUtTTL(int utTTL)

getUtFutureTTL

public int getUtFutureTTL()

setUtFutureTTL

public void setUtFutureTTL(int utFutureTTL)

isValidateSamlSubjectConfirmation

public boolean isValidateSamlSubjectConfirmation()

setValidateSamlSubjectConfirmation

public void setValidateSamlSubjectConfirmation(boolean validateSamlSubjectConfirmation)

getCurrentTime

public WSTimeSource getCurrentTime()

setCurrentTime

public void setCurrentTime(WSTimeSource currentTime)


Copyright © 2004–2014 The Apache Software Foundation. All rights reserved.