Spring Web Services Framework

org.springframework.ws.soap.security.wss4j.callback
Class AbstractWsPasswordCallbackHandler

java.lang.Object
  extended by org.springframework.ws.soap.security.callback.AbstractCallbackHandler
      extended by org.springframework.ws.soap.security.wss4j.callback.AbstractWsPasswordCallbackHandler
All Implemented Interfaces:
CallbackHandler
Direct Known Subclasses:
KeyStoreCallbackHandler, SimplePasswordValidationCallbackHandler, SpringSecurityPasswordValidationCallbackHandler

public abstract class AbstractWsPasswordCallbackHandler
extends AbstractCallbackHandler

Abstract base class for CallbackHandler implementations that handle WSPasswordCallback callbacks.

Since:
1.5.0
Author:
Arjen Poutsma

Field Summary
 
Fields inherited from class org.springframework.ws.soap.security.callback.AbstractCallbackHandler
logger
 
Constructor Summary
AbstractWsPasswordCallbackHandler()
           
 
Method Summary
protected  void handleCleanup(CleanupCallback callback)
          Invoked when a CleanupCallback is passed to AbstractCallbackHandler.handle(Callback[]).
protected  void handleCustomToken(WSPasswordCallback callback)
          Invoked when the callback has a WSPasswordCallback.CUSTOM_TOKEN usage.
protected  void handleDecrypt(WSPasswordCallback callback)
          Invoked when the callback has a WSPasswordCallback.DECRYPT usage.
protected  void handleInternal(Callback callback)
          Handles WSPasswordCallback callbacks.
protected  void handleSecretKey(WSPasswordCallback callback)
          Invoked when the callback has a WSPasswordCallback.SECRET_KEY usage.
protected  void handleSecurityContextToken(WSPasswordCallback callback)
          Invoked when the callback has a WSPasswordCallback.SECURITY_CONTEXT_TOKEN usage.
protected  void handleSignature(WSPasswordCallback callback)
          Invoked when the callback has a WSPasswordCallback.SIGNATURE usage.
protected  void handleUsernameToken(WSPasswordCallback callback)
          Invoked when the callback has a WSPasswordCallback.USERNAME_TOKEN usage.
protected  void handleUsernameTokenPrincipal(UsernameTokenPrincipalCallback callback)
          Invoked when a UsernameTokenPrincipalCallback is passed to AbstractCallbackHandler.handle(Callback[]).
 
Methods inherited from class org.springframework.ws.soap.security.callback.AbstractCallbackHandler
handle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractWsPasswordCallbackHandler

public AbstractWsPasswordCallbackHandler()
Method Detail

handleInternal

protected final void handleInternal(Callback callback)
                             throws IOException,
                                    UnsupportedCallbackException
Handles WSPasswordCallback callbacks. Inspects the callback usage code, and calls the various handle* template methods.

Specified by:
handleInternal in class AbstractCallbackHandler
Parameters:
callback - the callback
Throws:
IOException - in case of I/O errors
UnsupportedCallbackException - when the callback is not supported

handleDecrypt

protected void handleDecrypt(WSPasswordCallback callback)
                      throws IOException,
                             UnsupportedCallbackException
Invoked when the callback has a WSPasswordCallback.DECRYPT usage.

This method is invoked when WSS4J needs a password to get the private key of the identifier (username) from the keystore. WSS4J uses this private key to decrypt the session (symmetric) key. Because the encryption method uses the public key to encrypt the session key it needs no password (a public key is usually not protected by a password).

Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

handleUsernameToken

protected void handleUsernameToken(WSPasswordCallback callback)
                            throws IOException,
                                   UnsupportedCallbackException
Invoked when the callback has a WSPasswordCallback.USERNAME_TOKEN usage.

This method is invoked when WSS4J needs the password to fill in or to verify a UsernameToken.

Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

handleSignature

protected void handleSignature(WSPasswordCallback callback)
                        throws IOException,
                               UnsupportedCallbackException
Invoked when the callback has a WSPasswordCallback.SIGNATURE usage.

This method is invoked when WSS4J needs the password to get the private key of the identifier (username) from the keystore. WSS4J uses this private key to produce a signature. The signature verfication uses the public key to verfiy the signature.

Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

handleSecurityContextToken

protected void handleSecurityContextToken(WSPasswordCallback callback)
                                   throws IOException,
                                          UnsupportedCallbackException
Invoked when the callback has a WSPasswordCallback.SECURITY_CONTEXT_TOKEN usage.

This method is invoked when WSS4J needs the key to to be associated with a SecurityContextToken.

Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

handleCustomToken

protected void handleCustomToken(WSPasswordCallback callback)
                          throws IOException,
                                 UnsupportedCallbackException
Invoked when the callback has a WSPasswordCallback.CUSTOM_TOKEN usage.

Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

handleSecretKey

protected void handleSecretKey(WSPasswordCallback callback)
                        throws IOException,
                               UnsupportedCallbackException
Invoked when the callback has a WSPasswordCallback.SECRET_KEY usage.

Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

handleCleanup

protected void handleCleanup(CleanupCallback callback)
                      throws IOException,
                             UnsupportedCallbackException
Invoked when a CleanupCallback is passed to AbstractCallbackHandler.handle(Callback[]).

Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

handleUsernameTokenPrincipal

protected void handleUsernameTokenPrincipal(UsernameTokenPrincipalCallback callback)
                                     throws IOException,
                                            UnsupportedCallbackException
Invoked when a UsernameTokenPrincipalCallback is passed to AbstractCallbackHandler.handle(Callback[]).

Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

Spring Web Services Framework

Copyright © 2005-2013 The Spring Web Services Framework. All Rights Reserved.