org.apache.servicemix.soap.handlers.security
Class BaseSecurityCallbackHandler

java.lang.Object
  extended by org.apache.servicemix.soap.handlers.security.BaseSecurityCallbackHandler
All Implemented Interfaces:
CallbackHandler
Direct Known Subclasses:
WSSecurityHandler.DefaultHandler

public class BaseSecurityCallbackHandler
extends Object
implements CallbackHandler

Base implementation for security callback handler.

Author:
gnodet

Constructor Summary
BaseSecurityCallbackHandler()
           
 
Method Summary
 void handle(Callback[] callbacks)
           
protected  void processCallback(org.apache.ws.security.WSPasswordCallback callback)
           
protected  void processDecrypt(org.apache.ws.security.WSPasswordCallback callback)
          Need a password to get the private key of this identifier (username) from the keystore.
protected  void processKeyName(org.apache.ws.security.WSPasswordCallback callback)
          Need the key, not the password, associated with the identifier.
protected  void processSignature(org.apache.ws.security.WSPasswordCallback callback)
          Need the password to get the private key of this identifier (username) from the keystore.
protected  void processUsernameToken(org.apache.ws.security.WSPasswordCallback callback)
          Need the password to fill in or to verify a UsernameToken
protected  void processUsernameTokenUnkown(org.apache.ws.security.WSPasswordCallback callback)
          Either a not specified password type or a password type passwordText.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseSecurityCallbackHandler

public BaseSecurityCallbackHandler()
Method Detail

handle

public void handle(Callback[] callbacks)
            throws IOException,
                   UnsupportedCallbackException
Specified by:
handle in interface CallbackHandler
Throws:
IOException
UnsupportedCallbackException

processCallback

protected void processCallback(org.apache.ws.security.WSPasswordCallback callback)
                        throws IOException,
                               UnsupportedCallbackException
Throws:
IOException
UnsupportedCallbackException

processDecrypt

protected void processDecrypt(org.apache.ws.security.WSPasswordCallback callback)
                       throws IOException,
                              UnsupportedCallbackException
Need a password to get the private key of this 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)

Throws:
IOException
UnsupportedCallbackException

processUsernameToken

protected void processUsernameToken(org.apache.ws.security.WSPasswordCallback callback)
                             throws IOException,
                                    UnsupportedCallbackException
Need the password to fill in or to verify a UsernameToken

Throws:
IOException
UnsupportedCallbackException

processSignature

protected void processSignature(org.apache.ws.security.WSPasswordCallback callback)
                         throws IOException,
                                UnsupportedCallbackException
Need the password to get the private key of this 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

Throws:
IOException
UnsupportedCallbackException

processKeyName

protected void processKeyName(org.apache.ws.security.WSPasswordCallback callback)
                       throws IOException,
                              UnsupportedCallbackException
Need the key, not the password, associated with the identifier. WSS4J uses this key to encrypt or decrypt parts of the SOAP request. Note, the key must match the symmetric encryption/decryption algorithm specified (refer to WSHandlerConstants.ENC_SYM_ALGO)

Throws:
IOException
UnsupportedCallbackException

processUsernameTokenUnkown

protected void processUsernameTokenUnkown(org.apache.ws.security.WSPasswordCallback callback)
                                   throws IOException,
                                          UnsupportedCallbackException
Either a not specified password type or a password type passwordText. In these both cases only the password variable is set. The callback class now may check if the username and password match. If they don't match the callback class must throw an exception. The exception can be a UnsupportedCallbackException or an IOException.

Throws:
IOException
UnsupportedCallbackException


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.