Spring Web Services Framework

org.springframework.ws.soap.security.xwss.callback
Class CryptographyCallbackHandler

java.lang.Object
  extended by org.springframework.ws.soap.security.callback.AbstractCallbackHandler
      extended by org.springframework.ws.soap.security.xwss.callback.CryptographyCallbackHandler
All Implemented Interfaces:
CallbackHandler
Direct Known Subclasses:
KeyStoreCallbackHandler

public class CryptographyCallbackHandler
extends AbstractCallbackHandler

Default callback handler that handles cryptographic callback. This handler determines the exact callback passed, and calls a template method for it. By default, all template methods throw an UnsupportedCallbackException, so you only need to override those you need.

Since:
1.0.0
Author:
Arjen Poutsma

Field Summary
 
Fields inherited from class org.springframework.ws.soap.security.callback.AbstractCallbackHandler
logger
 
Constructor Summary
CryptographyCallbackHandler()
           
 
Method Summary
protected  void handleAliasPrivKeyCertRequest(SignatureKeyCallback callback, SignatureKeyCallback.AliasPrivKeyCertRequest request)
          Template method that handles SignatureKeyCallbacks with AliasPrivKeyCertRequests.
protected  void handleAliasSymmetricKeyRequest(DecryptionKeyCallback callback, DecryptionKeyCallback.AliasSymmetricKeyRequest request)
          Template method that handles DecryptionKeyCallbacks with AliasSymmetricKeyRequests.
protected  void handleAliasSymmetricKeyRequest(EncryptionKeyCallback callback, EncryptionKeyCallback.AliasSymmetricKeyRequest request)
          Template method that handles EncryptionKeyCallbacks with AliasSymmetricKeyRequests.
protected  void handleAliasX509CertificateRequest(EncryptionKeyCallback callback, EncryptionKeyCallback.AliasX509CertificateRequest request)
          Template method that handles EncryptionKeyCallbacks with AliasX509CertificateRequests.
protected  void handleCertificateValidationCallback(CertificateValidationCallback callback)
          Template method that handles CertificateValidationCallbacks.
protected  void handleDecryptionKeyCallback(DecryptionKeyCallback callback)
          Method that handles DecryptionKeyCallbacks.
protected  void handleDefaultPrivKeyCertRequest(SignatureKeyCallback callback, SignatureKeyCallback.DefaultPrivKeyCertRequest request)
          Template method that handles SignatureKeyCallbacks with DefaultPrivKeyCertRequests.
protected  void handleDefaultX509CertificateRequest(EncryptionKeyCallback callback, EncryptionKeyCallback.DefaultX509CertificateRequest request)
          Template method that handles EncryptionKeyCallbacks with DefaultX509CertificateRequests.
protected  void handleEncryptionKeyCallback(EncryptionKeyCallback callback)
          Method that handles EncryptionKeyCallbacks.
protected  void handleInternal(Callback callback)
          Template method that should be implemented by subclasses.
protected  void handlePrivateKeyRequest(DecryptionKeyCallback callback, DecryptionKeyCallback.PrivateKeyRequest request)
          Method that handles DecryptionKeyCallbacks with PrivateKeyRequest .
protected  void handlePrivKeyCertRequest(SignatureKeyCallback cb, SignatureKeyCallback.PrivKeyCertRequest request)
          Method that handles SignatureKeyCallbacks with PrivKeyCertRequests.
protected  void handlePublicKeyBasedPrivKeyCertRequest(SignatureKeyCallback callback, SignatureKeyCallback.PublicKeyBasedPrivKeyCertRequest request)
          Template method that handles SignatureKeyCallbacks with PublicKeyBasedPrivKeyCertRequests.
protected  void handlePublicKeyBasedPrivKeyRequest(DecryptionKeyCallback callback, DecryptionKeyCallback.PublicKeyBasedPrivKeyRequest request)
          Template method that handles DecryptionKeyCallbacks with PublicKeyBasedPrivKeyRequests.
protected  void handlePublicKeyBasedRequest(EncryptionKeyCallback callback, EncryptionKeyCallback.PublicKeyBasedRequest request)
          Template method that handles EncryptionKeyCallbacks with PublicKeyBasedRequests.
protected  void handlePublicKeyBasedRequest(SignatureVerificationKeyCallback callback, SignatureVerificationKeyCallback.PublicKeyBasedRequest request)
          Template method that handles SignatureKeyCallbacks with PublicKeyBasedRequests.
protected  void handleSignatureKeyCallback(SignatureKeyCallback callback)
          Method that handles SignatureKeyCallbacks.
protected  void handleSignatureVerificationKeyCallback(SignatureVerificationKeyCallback callback)
          Method that handles SignatureVerificationKeyCallbacks.
protected  void handleSymmetricKeyRequest(DecryptionKeyCallback callback, DecryptionKeyCallback.SymmetricKeyRequest request)
          Method that handles DecryptionKeyCallbacks with SymmetricKeyRequest .
protected  void handleSymmetricKeyRequest(EncryptionKeyCallback callback, EncryptionKeyCallback.SymmetricKeyRequest request)
          Method that handles EncryptionKeyCallbacks with SymmetricKeyRequest .
protected  void handleX509CertificateBasedRequest(DecryptionKeyCallback callback, DecryptionKeyCallback.X509CertificateBasedRequest request)
          Template method that handles DecryptionKeyCallbacks with X509CertificateBasedRequests.
protected  void handleX509CertificateRequest(EncryptionKeyCallback callback, EncryptionKeyCallback.X509CertificateRequest request)
          Method that handles EncryptionKeyCallbacks with X509CertificateRequest .
protected  void handleX509CertificateRequest(SignatureVerificationKeyCallback callback, SignatureVerificationKeyCallback.X509CertificateRequest request)
          Method that handles SignatureVerificationKeyCallbacks with X509CertificateRequests.
protected  void handleX509IssuerSerialBasedRequest(DecryptionKeyCallback callback, DecryptionKeyCallback.X509IssuerSerialBasedRequest request)
          Template method that handles DecryptionKeyCallbacks with X509IssuerSerialBasedRequests.
protected  void handleX509IssuerSerialBasedRequest(SignatureVerificationKeyCallback callback, SignatureVerificationKeyCallback.X509IssuerSerialBasedRequest request)
          Template method that handles SignatureKeyCallbacks with X509IssuerSerialBasedRequests.
protected  void handleX509SubjectKeyIdentifierBasedRequest(DecryptionKeyCallback callback, DecryptionKeyCallback.X509SubjectKeyIdentifierBasedRequest request)
          Template method that handles DecryptionKeyCallbacks with X509SubjectKeyIdentifierBasedRequests.
protected  void handleX509SubjectKeyIdentifierBasedRequest(SignatureVerificationKeyCallback callback, SignatureVerificationKeyCallback.X509SubjectKeyIdentifierBasedRequest request)
          Template method that handles SignatureKeyCallbacks with PublicKeyBasedPrivKeyCertRequests.
 
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

CryptographyCallbackHandler

public CryptographyCallbackHandler()
Method Detail

handleInternal

protected final void handleInternal(Callback callback)
                             throws IOException,
                                    UnsupportedCallbackException
Description copied from class: AbstractCallbackHandler
Template method that should be implemented by subclasses.

Specified by:
handleInternal in class AbstractCallbackHandler
Throws:
IOException
UnsupportedCallbackException

handleCertificateValidationCallback

protected void handleCertificateValidationCallback(CertificateValidationCallback callback)
                                            throws IOException,
                                                   UnsupportedCallbackException
Template method that handles CertificateValidationCallbacks. Called from handleInternal(). Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

handleDecryptionKeyCallback

protected final void handleDecryptionKeyCallback(DecryptionKeyCallback callback)
                                          throws IOException,
                                                 UnsupportedCallbackException
Method that handles DecryptionKeyCallbacks. Called from handleInternal(). Default implementation delegates to specific handling methods.

Throws:
IOException
UnsupportedCallbackException
See Also:
handlePrivateKeyRequest(com.sun.xml.wss.impl.callback.DecryptionKeyCallback, com.sun.xml.wss.impl.callback.DecryptionKeyCallback.PrivateKeyRequest), handleSymmetricKeyRequest(com.sun.xml.wss.impl.callback.DecryptionKeyCallback, com.sun.xml.wss.impl.callback.DecryptionKeyCallback.SymmetricKeyRequest)

handlePrivateKeyRequest

protected final void handlePrivateKeyRequest(DecryptionKeyCallback callback,
                                             DecryptionKeyCallback.PrivateKeyRequest request)
                                      throws IOException,
                                             UnsupportedCallbackException
Method that handles DecryptionKeyCallbacks with PrivateKeyRequest . Called from handleDecryptionKeyCallback(). Default implementation delegates to specific handling methods.

Throws:
IOException
UnsupportedCallbackException
See Also:
handlePublicKeyBasedPrivKeyCertRequest(com.sun.xml.wss.impl.callback.SignatureKeyCallback, com.sun.xml.wss.impl.callback.SignatureKeyCallback.PublicKeyBasedPrivKeyCertRequest), handleX509CertificateBasedRequest(com.sun.xml.wss.impl.callback.DecryptionKeyCallback, com.sun.xml.wss.impl.callback.DecryptionKeyCallback.X509CertificateBasedRequest), handleX509IssuerSerialBasedRequest(com.sun.xml.wss.impl.callback.DecryptionKeyCallback, com.sun.xml.wss.impl.callback.DecryptionKeyCallback.X509IssuerSerialBasedRequest), handleX509SubjectKeyIdentifierBasedRequest(com.sun.xml.wss.impl.callback.DecryptionKeyCallback, com.sun.xml.wss.impl.callback.DecryptionKeyCallback.X509SubjectKeyIdentifierBasedRequest)

handlePublicKeyBasedPrivKeyRequest

protected void handlePublicKeyBasedPrivKeyRequest(DecryptionKeyCallback callback,
                                                  DecryptionKeyCallback.PublicKeyBasedPrivKeyRequest request)
                                           throws IOException,
                                                  UnsupportedCallbackException
Template method that handles DecryptionKeyCallbacks with PublicKeyBasedPrivKeyRequests. Called from handlePrivateKeyRequest(). Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

handleX509CertificateBasedRequest

protected void handleX509CertificateBasedRequest(DecryptionKeyCallback callback,
                                                 DecryptionKeyCallback.X509CertificateBasedRequest request)
                                          throws IOException,
                                                 UnsupportedCallbackException
Template method that handles DecryptionKeyCallbacks with X509CertificateBasedRequests. Called from handlePrivateKeyRequest(). Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

handleX509IssuerSerialBasedRequest

protected void handleX509IssuerSerialBasedRequest(DecryptionKeyCallback callback,
                                                  DecryptionKeyCallback.X509IssuerSerialBasedRequest request)
                                           throws IOException,
                                                  UnsupportedCallbackException
Template method that handles DecryptionKeyCallbacks with X509IssuerSerialBasedRequests. Called from handlePrivateKeyRequest(). Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

handleX509SubjectKeyIdentifierBasedRequest

protected void handleX509SubjectKeyIdentifierBasedRequest(DecryptionKeyCallback callback,
                                                          DecryptionKeyCallback.X509SubjectKeyIdentifierBasedRequest request)
                                                   throws IOException,
                                                          UnsupportedCallbackException
Template method that handles DecryptionKeyCallbacks with X509SubjectKeyIdentifierBasedRequests. Called from handlePrivateKeyRequest(). Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

handleSymmetricKeyRequest

protected final void handleSymmetricKeyRequest(DecryptionKeyCallback callback,
                                               DecryptionKeyCallback.SymmetricKeyRequest request)
                                        throws IOException,
                                               UnsupportedCallbackException
Method that handles DecryptionKeyCallbacks with SymmetricKeyRequest . Called from handleDecryptionKeyCallback(). Default implementation delegates to specific handling methods.

Throws:
IOException
UnsupportedCallbackException
See Also:
handleAliasSymmetricKeyRequest(com.sun.xml.wss.impl.callback.DecryptionKeyCallback, com.sun.xml.wss.impl.callback.DecryptionKeyCallback.AliasSymmetricKeyRequest)

handleAliasSymmetricKeyRequest

protected void handleAliasSymmetricKeyRequest(DecryptionKeyCallback callback,
                                              DecryptionKeyCallback.AliasSymmetricKeyRequest request)
                                       throws IOException,
                                              UnsupportedCallbackException
Template method that handles DecryptionKeyCallbacks with AliasSymmetricKeyRequests. Called from handleSymmetricKeyRequest(). Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

handleEncryptionKeyCallback

protected final void handleEncryptionKeyCallback(EncryptionKeyCallback callback)
                                          throws IOException,
                                                 UnsupportedCallbackException
Method that handles EncryptionKeyCallbacks. Called from handleInternal(). Default implementation delegates to specific handling methods.

Throws:
IOException
UnsupportedCallbackException
See Also:
handleSymmetricKeyRequest(com.sun.xml.wss.impl.callback.EncryptionKeyCallback, com.sun.xml.wss.impl.callback.EncryptionKeyCallback.SymmetricKeyRequest), handleX509CertificateRequest(com.sun.xml.wss.impl.callback.EncryptionKeyCallback, com.sun.xml.wss.impl.callback.EncryptionKeyCallback.X509CertificateRequest)

handleSymmetricKeyRequest

protected final void handleSymmetricKeyRequest(EncryptionKeyCallback callback,
                                               EncryptionKeyCallback.SymmetricKeyRequest request)
                                        throws IOException,
                                               UnsupportedCallbackException
Method that handles EncryptionKeyCallbacks with SymmetricKeyRequest . Called from handleEncryptionKeyCallback(). Default implementation delegates to specific handling methods.

Throws:
IOException
UnsupportedCallbackException
See Also:
handleAliasSymmetricKeyRequest(com.sun.xml.wss.impl.callback.EncryptionKeyCallback, com.sun.xml.wss.impl.callback.EncryptionKeyCallback.AliasSymmetricKeyRequest)

handleAliasSymmetricKeyRequest

protected void handleAliasSymmetricKeyRequest(EncryptionKeyCallback callback,
                                              EncryptionKeyCallback.AliasSymmetricKeyRequest request)
                                       throws IOException,
                                              UnsupportedCallbackException
Template method that handles EncryptionKeyCallbacks with AliasSymmetricKeyRequests. Called from handleSymmetricKeyRequest(). Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

handleX509CertificateRequest

protected final void handleX509CertificateRequest(EncryptionKeyCallback callback,
                                                  EncryptionKeyCallback.X509CertificateRequest request)
                                           throws IOException,
                                                  UnsupportedCallbackException
Method that handles EncryptionKeyCallbacks with X509CertificateRequest . Called from handleEncryptionKeyCallback(). Default implementation delegates to specific handling methods.

Throws:
IOException
UnsupportedCallbackException
See Also:
handleAliasX509CertificateRequest(com.sun.xml.wss.impl.callback.EncryptionKeyCallback, com.sun.xml.wss.impl.callback.EncryptionKeyCallback.AliasX509CertificateRequest), handleDefaultX509CertificateRequest(com.sun.xml.wss.impl.callback.EncryptionKeyCallback, com.sun.xml.wss.impl.callback.EncryptionKeyCallback.DefaultX509CertificateRequest), handlePublicKeyBasedRequest(com.sun.xml.wss.impl.callback.EncryptionKeyCallback, com.sun.xml.wss.impl.callback.EncryptionKeyCallback.PublicKeyBasedRequest)

handleAliasX509CertificateRequest

protected void handleAliasX509CertificateRequest(EncryptionKeyCallback callback,
                                                 EncryptionKeyCallback.AliasX509CertificateRequest request)
                                          throws IOException,
                                                 UnsupportedCallbackException
Template method that handles EncryptionKeyCallbacks with AliasX509CertificateRequests. Called from handleX509CertificateRequest(). Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

handleDefaultX509CertificateRequest

protected void handleDefaultX509CertificateRequest(EncryptionKeyCallback callback,
                                                   EncryptionKeyCallback.DefaultX509CertificateRequest request)
                                            throws IOException,
                                                   UnsupportedCallbackException
Template method that handles EncryptionKeyCallbacks with DefaultX509CertificateRequests. Called from handleX509CertificateRequest(). Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

handlePublicKeyBasedRequest

protected void handlePublicKeyBasedRequest(EncryptionKeyCallback callback,
                                           EncryptionKeyCallback.PublicKeyBasedRequest request)
                                    throws IOException,
                                           UnsupportedCallbackException
Template method that handles EncryptionKeyCallbacks with PublicKeyBasedRequests. Called from handleX509CertificateRequest(). Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

handleSignatureKeyCallback

protected final void handleSignatureKeyCallback(SignatureKeyCallback callback)
                                         throws IOException,
                                                UnsupportedCallbackException
Method that handles SignatureKeyCallbacks. Called from handleInternal(). Default implementation delegates to specific handling methods.

Throws:
IOException
UnsupportedCallbackException
See Also:
handlePrivKeyCertRequest(com.sun.xml.wss.impl.callback.SignatureKeyCallback, com.sun.xml.wss.impl.callback.SignatureKeyCallback.PrivKeyCertRequest)

handlePrivKeyCertRequest

protected final void handlePrivKeyCertRequest(SignatureKeyCallback cb,
                                              SignatureKeyCallback.PrivKeyCertRequest request)
                                       throws IOException,
                                              UnsupportedCallbackException
Method that handles SignatureKeyCallbacks with PrivKeyCertRequests. Called from handleSignatureKeyCallback(). Default implementation delegates to specific handling methods.

Throws:
IOException
UnsupportedCallbackException
See Also:
handleDefaultPrivKeyCertRequest(com.sun.xml.wss.impl.callback.SignatureKeyCallback, com.sun.xml.wss.impl.callback.SignatureKeyCallback.DefaultPrivKeyCertRequest), handleAliasPrivKeyCertRequest(com.sun.xml.wss.impl.callback.SignatureKeyCallback, com.sun.xml.wss.impl.callback.SignatureKeyCallback.AliasPrivKeyCertRequest), handlePublicKeyBasedPrivKeyCertRequest(com.sun.xml.wss.impl.callback.SignatureKeyCallback, com.sun.xml.wss.impl.callback.SignatureKeyCallback.PublicKeyBasedPrivKeyCertRequest)

handleDefaultPrivKeyCertRequest

protected void handleDefaultPrivKeyCertRequest(SignatureKeyCallback callback,
                                               SignatureKeyCallback.DefaultPrivKeyCertRequest request)
                                        throws IOException,
                                               UnsupportedCallbackException
Template method that handles SignatureKeyCallbacks with DefaultPrivKeyCertRequests. Called from handlePrivKeyCertRequest(). Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

handleAliasPrivKeyCertRequest

protected void handleAliasPrivKeyCertRequest(SignatureKeyCallback callback,
                                             SignatureKeyCallback.AliasPrivKeyCertRequest request)
                                      throws IOException,
                                             UnsupportedCallbackException
Template method that handles SignatureKeyCallbacks with AliasPrivKeyCertRequests. Called from handlePrivKeyCertRequest(). Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

handlePublicKeyBasedPrivKeyCertRequest

protected void handlePublicKeyBasedPrivKeyCertRequest(SignatureKeyCallback callback,
                                                      SignatureKeyCallback.PublicKeyBasedPrivKeyCertRequest request)
                                               throws IOException,
                                                      UnsupportedCallbackException
Template method that handles SignatureKeyCallbacks with PublicKeyBasedPrivKeyCertRequests. Called from handlePrivKeyCertRequest(). Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

handleSignatureVerificationKeyCallback

protected final void handleSignatureVerificationKeyCallback(SignatureVerificationKeyCallback callback)
                                                     throws UnsupportedCallbackException,
                                                            IOException
Method that handles SignatureVerificationKeyCallbacks. Called from handleInternal(). Default implementation delegates to specific handling methods.

Throws:
UnsupportedCallbackException
IOException
See Also:
handleX509CertificateRequest(com.sun.xml.wss.impl.callback.SignatureVerificationKeyCallback, com.sun.xml.wss.impl.callback.SignatureVerificationKeyCallback.X509CertificateRequest)

handleX509CertificateRequest

protected final void handleX509CertificateRequest(SignatureVerificationKeyCallback callback,
                                                  SignatureVerificationKeyCallback.X509CertificateRequest request)
                                           throws UnsupportedCallbackException,
                                                  IOException
Method that handles SignatureVerificationKeyCallbacks with X509CertificateRequests. Called from handleSignatureVerificationKeyCallback(). Default implementation delegates to specific handling methods.

Throws:
UnsupportedCallbackException
IOException
See Also:
handlePublicKeyBasedRequest(com.sun.xml.wss.impl.callback.SignatureVerificationKeyCallback, com.sun.xml.wss.impl.callback.SignatureVerificationKeyCallback.PublicKeyBasedRequest), handleX509IssuerSerialBasedRequest(com.sun.xml.wss.impl.callback.SignatureVerificationKeyCallback, com.sun.xml.wss.impl.callback.SignatureVerificationKeyCallback.X509IssuerSerialBasedRequest), handleX509SubjectKeyIdentifierBasedRequest(com.sun.xml.wss.impl.callback.SignatureVerificationKeyCallback, com.sun.xml.wss.impl.callback.SignatureVerificationKeyCallback.X509SubjectKeyIdentifierBasedRequest)

handleX509SubjectKeyIdentifierBasedRequest

protected void handleX509SubjectKeyIdentifierBasedRequest(SignatureVerificationKeyCallback callback,
                                                          SignatureVerificationKeyCallback.X509SubjectKeyIdentifierBasedRequest request)
                                                   throws IOException,
                                                          UnsupportedCallbackException
Template method that handles SignatureKeyCallbacks with PublicKeyBasedPrivKeyCertRequests. Called from handlePrivKeyCertRequest(). Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

handleX509IssuerSerialBasedRequest

protected void handleX509IssuerSerialBasedRequest(SignatureVerificationKeyCallback callback,
                                                  SignatureVerificationKeyCallback.X509IssuerSerialBasedRequest request)
                                           throws IOException,
                                                  UnsupportedCallbackException
Template method that handles SignatureKeyCallbacks with X509IssuerSerialBasedRequests. Called from handlePrivKeyCertRequest(). Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

handlePublicKeyBasedRequest

protected void handlePublicKeyBasedRequest(SignatureVerificationKeyCallback callback,
                                           SignatureVerificationKeyCallback.PublicKeyBasedRequest request)
                                    throws IOException,
                                           UnsupportedCallbackException
Template method that handles SignatureKeyCallbacks with PublicKeyBasedRequests. Called from handlePrivKeyCertRequest(). Default implementation throws an UnsupportedCallbackException.

Throws:
IOException
UnsupportedCallbackException

Spring Web Services Framework

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