org.apache.cxf.ws.security.wss4j
Class AbstractWSS4JStaxInterceptor

java.lang.Object
  extended by org.apache.cxf.ws.security.wss4j.AbstractWSS4JStaxInterceptor
All Implemented Interfaces:
org.apache.cxf.binding.soap.interceptor.SoapInterceptor, org.apache.cxf.interceptor.Interceptor<org.apache.cxf.binding.soap.SoapMessage>, org.apache.cxf.phase.PhaseInterceptor<org.apache.cxf.binding.soap.SoapMessage>
Direct Known Subclasses:
WSS4JStaxInInterceptor, WSS4JStaxOutInterceptor

public abstract class AbstractWSS4JStaxInterceptor
extends Object
implements org.apache.cxf.binding.soap.interceptor.SoapInterceptor, org.apache.cxf.phase.PhaseInterceptor<org.apache.cxf.binding.soap.SoapMessage>


Constructor Summary
AbstractWSS4JStaxInterceptor()
           
AbstractWSS4JStaxInterceptor(Map<String,Object> properties)
           
AbstractWSS4JStaxInterceptor(org.apache.wss4j.stax.ext.WSSSecurityProperties securityProperties)
           
 
Method Summary
protected  void configureCallbackHandler(org.apache.cxf.binding.soap.SoapMessage soapMessage, org.apache.wss4j.stax.ext.WSSSecurityProperties securityProperties)
           
protected  org.apache.wss4j.stax.ext.WSSSecurityProperties createSecurityProperties()
           
 Collection<org.apache.cxf.phase.PhaseInterceptor<? extends org.apache.cxf.message.Message>> getAdditionalInterceptors()
           
 Set<String> getAfter()
           
 Set<String> getBefore()
           
protected  org.apache.wss4j.common.crypto.Crypto getEncryptionCrypto(Object e, org.apache.cxf.binding.soap.SoapMessage message, org.apache.wss4j.stax.ext.WSSSecurityProperties securityProperties)
           
protected  org.apache.cxf.ws.policy.AssertionInfo getFirstAssertionByLocalname(org.apache.cxf.ws.policy.AssertionInfoMap aim, String localname)
           
 String getId()
           
 Object getOption(String key)
           
 String getPassword(Object msgContext)
           
protected  org.apache.wss4j.common.crypto.PasswordEncryptor getPasswordEncryptor(org.apache.cxf.binding.soap.SoapMessage soapMessage, org.apache.wss4j.stax.ext.WSSSecurityProperties securityProperties)
           
 String getPhase()
           
 Map<String,Object> getProperties()
           
 Object getProperty(Object msgContext, String key)
           
 Set<URI> getRoles()
           
protected  org.apache.wss4j.common.crypto.Crypto getSignatureCrypto(Object s, org.apache.cxf.binding.soap.SoapMessage message, org.apache.wss4j.stax.ext.WSSSecurityProperties securityProperties)
           
 Set<QName> getUnderstoodHeaders()
           
 void handleFault(org.apache.cxf.binding.soap.SoapMessage message)
           
protected  boolean isRequestor(org.apache.cxf.binding.soap.SoapMessage message)
           
protected  org.apache.wss4j.common.crypto.Crypto loadCrypto(org.apache.cxf.binding.soap.SoapMessage soapMessage, String cryptoPropertyFile, String cryptoPropertyRefId, org.apache.wss4j.stax.ext.WSSSecurityProperties securityProperties)
          Load a Crypto instance.
protected  org.apache.wss4j.common.crypto.Crypto loadCryptoFromPropertiesFile(org.apache.cxf.binding.soap.SoapMessage soapMessage, String propFilename, org.apache.wss4j.stax.ext.WSSSecurityProperties securityProperties)
           
 void postHandleMessage(org.apache.cxf.binding.soap.SoapMessage message)
           
 void setId(String id)
           
 void setPassword(Object msgContext, String password)
           
 void setPhase(String phase)
           
 void setProperty(Object msgContext, String key, Object value)
           
protected  void translateProperties(org.apache.cxf.binding.soap.SoapMessage msg, org.apache.wss4j.stax.ext.WSSSecurityProperties securityProperties)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.cxf.interceptor.Interceptor
handleMessage
 

Constructor Detail

AbstractWSS4JStaxInterceptor

public AbstractWSS4JStaxInterceptor(org.apache.wss4j.stax.ext.WSSSecurityProperties securityProperties)

AbstractWSS4JStaxInterceptor

public AbstractWSS4JStaxInterceptor(Map<String,Object> properties)

AbstractWSS4JStaxInterceptor

public AbstractWSS4JStaxInterceptor()
Method Detail

createSecurityProperties

protected org.apache.wss4j.stax.ext.WSSSecurityProperties createSecurityProperties()

translateProperties

protected void translateProperties(org.apache.cxf.binding.soap.SoapMessage msg,
                                   org.apache.wss4j.stax.ext.WSSSecurityProperties securityProperties)

configureCallbackHandler

protected void configureCallbackHandler(org.apache.cxf.binding.soap.SoapMessage soapMessage,
                                        org.apache.wss4j.stax.ext.WSSSecurityProperties securityProperties)
                                 throws org.apache.wss4j.common.ext.WSSecurityException
Throws:
org.apache.wss4j.common.ext.WSSecurityException

getRoles

public Set<URI> getRoles()
Specified by:
getRoles in interface org.apache.cxf.binding.soap.interceptor.SoapInterceptor

handleFault

public void handleFault(org.apache.cxf.binding.soap.SoapMessage message)
Specified by:
handleFault in interface org.apache.cxf.interceptor.Interceptor<org.apache.cxf.binding.soap.SoapMessage>

postHandleMessage

public void postHandleMessage(org.apache.cxf.binding.soap.SoapMessage message)
                       throws org.apache.cxf.interceptor.Fault
Throws:
org.apache.cxf.interceptor.Fault

getAdditionalInterceptors

public Collection<org.apache.cxf.phase.PhaseInterceptor<? extends org.apache.cxf.message.Message>> getAdditionalInterceptors()
Specified by:
getAdditionalInterceptors in interface org.apache.cxf.phase.PhaseInterceptor<org.apache.cxf.binding.soap.SoapMessage>

getPhase

public String getPhase()
Specified by:
getPhase in interface org.apache.cxf.phase.PhaseInterceptor<org.apache.cxf.binding.soap.SoapMessage>

setPhase

public void setPhase(String phase)

getOption

public Object getOption(String key)

getPassword

public String getPassword(Object msgContext)

getProperty

public Object getProperty(Object msgContext,
                          String key)

setPassword

public void setPassword(Object msgContext,
                        String password)

setProperty

public void setProperty(Object msgContext,
                        String key,
                        Object value)

getId

public String getId()
Specified by:
getId in interface org.apache.cxf.phase.PhaseInterceptor<org.apache.cxf.binding.soap.SoapMessage>

setId

public void setId(String id)

getUnderstoodHeaders

public Set<QName> getUnderstoodHeaders()
Specified by:
getUnderstoodHeaders in interface org.apache.cxf.binding.soap.interceptor.SoapInterceptor

getProperties

public Map<String,Object> getProperties()

getAfter

public Set<String> getAfter()
Specified by:
getAfter in interface org.apache.cxf.phase.PhaseInterceptor<org.apache.cxf.binding.soap.SoapMessage>

getBefore

public Set<String> getBefore()
Specified by:
getBefore in interface org.apache.cxf.phase.PhaseInterceptor<org.apache.cxf.binding.soap.SoapMessage>

isRequestor

protected boolean isRequestor(org.apache.cxf.binding.soap.SoapMessage message)

loadCrypto

protected org.apache.wss4j.common.crypto.Crypto loadCrypto(org.apache.cxf.binding.soap.SoapMessage soapMessage,
                                                           String cryptoPropertyFile,
                                                           String cryptoPropertyRefId,
                                                           org.apache.wss4j.stax.ext.WSSSecurityProperties securityProperties)
                                                    throws org.apache.wss4j.common.ext.WSSecurityException
Load a Crypto instance. Firstly, it tries to use the cryptoPropertyRefId tag to retrieve a Crypto object via a custom reference Id. Failing this, it tries to load the crypto instance via the cryptoPropertyFile tag.

Throws:
org.apache.wss4j.common.ext.WSSecurityException

loadCryptoFromPropertiesFile

protected org.apache.wss4j.common.crypto.Crypto loadCryptoFromPropertiesFile(org.apache.cxf.binding.soap.SoapMessage soapMessage,
                                                                             String propFilename,
                                                                             org.apache.wss4j.stax.ext.WSSSecurityProperties securityProperties)
                                                                      throws org.apache.wss4j.common.ext.WSSecurityException
Throws:
org.apache.wss4j.common.ext.WSSecurityException

getPasswordEncryptor

protected org.apache.wss4j.common.crypto.PasswordEncryptor getPasswordEncryptor(org.apache.cxf.binding.soap.SoapMessage soapMessage,
                                                                                org.apache.wss4j.stax.ext.WSSSecurityProperties securityProperties)

getFirstAssertionByLocalname

protected org.apache.cxf.ws.policy.AssertionInfo getFirstAssertionByLocalname(org.apache.cxf.ws.policy.AssertionInfoMap aim,
                                                                              String localname)

getEncryptionCrypto

protected org.apache.wss4j.common.crypto.Crypto getEncryptionCrypto(Object e,
                                                                    org.apache.cxf.binding.soap.SoapMessage message,
                                                                    org.apache.wss4j.stax.ext.WSSSecurityProperties securityProperties)
                                                             throws org.apache.wss4j.common.ext.WSSecurityException
Throws:
org.apache.wss4j.common.ext.WSSecurityException

getSignatureCrypto

protected org.apache.wss4j.common.crypto.Crypto getSignatureCrypto(Object s,
                                                                   org.apache.cxf.binding.soap.SoapMessage message,
                                                                   org.apache.wss4j.stax.ext.WSSSecurityProperties securityProperties)
                                                            throws org.apache.wss4j.common.ext.WSSecurityException
Throws:
org.apache.wss4j.common.ext.WSSecurityException


Apache CXF