Package org.apache.wss4j.dom.engine
Class WSSecurityEngine
- java.lang.Object
-
- org.apache.wss4j.dom.engine.WSSecurityEngine
-
public class WSSecurityEngine extends Object
WS-Security Engine.
-
-
Constructor Summary
Constructors Constructor Description WSSecurityEngine()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CallbackLookup
getCallbackLookup()
Get the CallbackLookup object to use to locate elementsWSSConfig
getWssConfig()
WSHandlerResult
processSecurityHeader(Document doc, String actor, CallbackHandler cb, Crypto crypto)
Process the security header given the soap envelope as W3C document.WSHandlerResult
processSecurityHeader(Document doc, String actor, CallbackHandler cb, Crypto sigVerCrypto, Crypto decCrypto)
Process the security header given the soap envelope as W3C document.WSHandlerResult
processSecurityHeader(Document doc, RequestData requestData)
Process the security header given the soap envelope as W3C document.WSHandlerResult
processSecurityHeader(Element securityHeader, String actor, CallbackHandler cb, Crypto sigVerCrypto, Crypto decCrypto)
Process the security header given thewsse:Security
DOM Element.WSHandlerResult
processSecurityHeader(Element securityHeader, RequestData requestData)
Process the security header given thewsse:Security
DOM Element.void
setCallbackLookup(CallbackLookup callbackLookup)
Set the CallbackLookup object to use to locate elementsWSSConfig
setWssConfig(WSSConfig cfg)
-
-
-
Method Detail
-
getWssConfig
public final WSSConfig getWssConfig()
- Returns:
- the WSSConfig object set on this instance
-
setWssConfig
public final WSSConfig setWssConfig(WSSConfig cfg)
- Parameters:
cfg
- the WSSConfig instance for this WSSecurityEngine to use- Returns:
- the WSSConfig instance previously set on this WSSecurityEngine instance
-
setCallbackLookup
public void setCallbackLookup(CallbackLookup callbackLookup)
Set the CallbackLookup object to use to locate elements- Parameters:
callbackLookup
- the CallbackLookup object to use to locate elements
-
getCallbackLookup
public CallbackLookup getCallbackLookup()
Get the CallbackLookup object to use to locate elements- Returns:
- the CallbackLookup object to use to locate elements
-
processSecurityHeader
public WSHandlerResult processSecurityHeader(Document doc, String actor, CallbackHandler cb, Crypto crypto) throws WSSecurityException
Process the security header given the soap envelope as W3C document. This is the main entry point to verify or decrypt a SOAP envelope. First check if awsse:Security
is available with the defined actor.- Parameters:
doc
- the SOAP envelope asDocument
actor
- the engine works on behalf of thisactor
. Refer to the SOAP specification aboutactor
orrole
cb
- a callback hander to the caller to resolve passwords during encryption and UsernameToken handlingcrypto
- the object that implements the access to the keystore and the handling of certificates.- Returns:
- a WSHandlerResult Object containing the results of processing the security header
- Throws:
WSSecurityException
- See Also:
WSSecurityEngine#processSecurityHeader(Element securityHeader, CallbackHandler cb, Crypto sigVerCrypto, Crypto decCrypto)
-
processSecurityHeader
public WSHandlerResult processSecurityHeader(Document doc, String actor, CallbackHandler cb, Crypto sigVerCrypto, Crypto decCrypto) throws WSSecurityException
Process the security header given the soap envelope as W3C document. This is the main entry point to verify or decrypt a SOAP envelope. First check if awsse:Security
is available with the defined actor.- Parameters:
doc
- the SOAP envelope asDocument
actor
- the engine works on behalf of thisactor
. Refer to the SOAP specification aboutactor
orrole
cb
- a callback hander to the caller to resolve passwords during encryption and UsernameToken handlingsigVerCrypto
- the object that implements the access to the keystore and the handling of certificates for Signature verificationdecCrypto
- the object that implements the access to the keystore and the handling of certificates for Decryption- Returns:
- a WSHandlerResult Object containing the results of processing the security header
- Throws:
WSSecurityException
- See Also:
WSSecurityEngine#processSecurityHeader( Element securityHeader, CallbackHandler cb, Crypto sigVerCrypto, Crypto decCrypto)
-
processSecurityHeader
public WSHandlerResult processSecurityHeader(Element securityHeader, String actor, CallbackHandler cb, Crypto sigVerCrypto, Crypto decCrypto) throws WSSecurityException
Process the security header given thewsse:Security
DOM Element. This function loops over all direct child elements of thewsse:Security
header. If it finds a known element, it transfers control to the appropriate handling function. The method processes the known child elements in the same order as they appear in thewsse:Security
element. This is in accordance to the WS Security specification. Currently the functions can handle the following child elements:ds:Signature
xenc:EncryptedKey
xenc:ReferenceList
wsse:UsernameToken
wsu:Timestamp
- Parameters:
securityHeader
- thewsse:Security
header elementcb
- a callback hander to the caller to resolve passwords during encryption and UsernameToken handlingsigVerCrypto
- the object that implements the access to the keystore and the handling of certificates used for Signature verificationdecCrypto
- the object that implements the access to the keystore and the handling of certificates used for Decryption- Returns:
- a WSHandlerResult Object containing the results of processing the security header
- Throws:
WSSecurityException
-
processSecurityHeader
public WSHandlerResult processSecurityHeader(Document doc, RequestData requestData) throws WSSecurityException
Process the security header given the soap envelope as W3C document. This is the main entry point to verify or decrypt a SOAP envelope. First check if awsse:Security
is available with the defined actor.- Parameters:
doc
- the SOAP envelope asDocument
requestData
- the RequestData associated with the request. It should be able to provide the callback handler, cryptos, etc... as needed by the processing- Returns:
- a WSHandlerResult Object containing the results of processing the security header
- Throws:
WSSecurityException
-
processSecurityHeader
public WSHandlerResult processSecurityHeader(Element securityHeader, RequestData requestData) throws WSSecurityException
Process the security header given thewsse:Security
DOM Element. This function loops over all direct child elements of thewsse:Security
header. If it finds a known element, it transfers control to the appropriate handling function. The method processes the known child elements in the same order as they appear in thewsse:Security
element. This is in accordance to the WS Security specification. Currently the functions can handle the following child elements:ds:Signature
xenc:EncryptedKey
xenc:ReferenceList
wsse:UsernameToken
wsu:Timestamp
- Parameters:
securityHeader
- thewsse:Security
header elementrequestData
- the RequestData associated with the request. It should be able to provide the callback handler, cryptos, etc... as needed by the processing- Returns:
- a WSHandlerResult Object containing the results of processing the security header
- Throws:
WSSecurityException
-
-