java.lang.Object
com.sun.xml.ws.commons.AbstractMOMRegistrationAware
com.sun.xml.wss.NonceManager
- All Implemented Interfaces:
com.sun.xml.ws.commons.MOMRegistrationAware
- Direct Known Subclasses:
DefaultNonceManager,HANonceManager
@ManagedObject
@Description("per-endpoint NonceManager")
@AMXMetadata(type="WSNonceManager")
public abstract class NonceManager
extends com.sun.xml.ws.commons.AbstractMOMRegistrationAware
This abstract class defines an SPI that Metro Application developers can implement, to handle custom
validation of Nonces used in conjunction with Password-Digest Authentication. A repeated nonce would
generally indicate a possible replay-attack.
The SPI implementation class needs to be
specified as a META-INF/services entry with name "com.sun.xml.xwss.NonceManager".
A default implementation of this SPI is returned if no entry is configured.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classException to be thrown when an Error in processing received nonces occurs. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddeleteInstance(com.sun.xml.ws.api.server.WSEndpoint endpoint) static NonceManagergetInstance(long maxNonceAge, com.sun.xml.ws.api.server.WSEndpoint endpoint) longvoidsetMaxNonceAge(long maxNonceAge) Set the approximate maximum age for which a received nonce needs to be stored by the NonceManagerabstract booleanvalidateNonce(String nonce, String created) Methods inherited from class com.sun.xml.ws.commons.AbstractMOMRegistrationAware
isRegisteredAtMOM, setRegisteredAtMOM
-
Field Details
-
LOGGER
-
nonceManager
- See Also:
-
-
Constructor Details
-
NonceManager
public NonceManager()
-
-
Method Details
-
getMaxNonceAge
@ManagedAttribute public long getMaxNonceAge()- Returns:
- the approximate maximum age for which a received nonce would be stored by the NonceManager
-
setMaxNonceAge
public void setMaxNonceAge(long maxNonceAge) Set the approximate maximum age for which a received nonce needs to be stored by the NonceManager -
validateNonce
public abstract boolean validateNonce(String nonce, String created) throws NonceManager.NonceException - Parameters:
nonce- the nonce to be validatedcreated- the creation time of the nonce as indicated in the UsernameToken- Returns:
- true if the nonce is not a replay
- Throws:
NonceManager.NonceException- if a replay is detected
-
getInstance
public static NonceManager getInstance(long maxNonceAge, com.sun.xml.ws.api.server.WSEndpoint endpoint) - Parameters:
maxNonceAge- the approximate maximum age for which a received nonce would be stored by the NonceManager- Returns:
- the singleton instance of the configured NonceManager, calling getInstance with different maxNonceAge will have no effect and will instead return the same NonceManager which was initialized first.
-
deleteInstance
public static void deleteInstance(com.sun.xml.ws.api.server.WSEndpoint endpoint)
-