Package org.apache.ws.security
Class WSSecurityEngine
- java.lang.Object
-
- org.apache.ws.security.WSSecurityEngine
-
public class WSSecurityEngine extends java.lang.ObjectWS-Security Engine.- Author:
- Davanum Srinivas (dims@yahoo.com)., Werner Dittmann (Werner.Dittmann@t-online.de).
-
-
Field Summary
Fields Modifier and Type Field Description static javax.xml.namespace.QNamebinaryTokenwsse:BinarySecurityTokenas defined by WS Security specificationstatic javax.xml.namespace.QNameDERIVED_KEY_TOKEN_05_02wsc:DerivedKeyTokenas defined by WS-SecureConversation specificationstatic javax.xml.namespace.QNameDERIVED_KEY_TOKEN_05_12wsc:DerivedKeyTokenas defined by WS-SecureConversation specification in WS-SXstatic javax.xml.namespace.QNameENCRYPTED_KEYxenc:EncryptedKeyas defined by XML Encryption specification, enhanced by WS Security specificationstatic javax.xml.namespace.QNameREFERENCE_LISTxenc:ReferenceListas defined by XML Encryption specification,static javax.xml.namespace.QNameSAML_TOKENsaml:Assertionas defined by SAML specificationstatic javax.xml.namespace.QNameSECURITY_CONTEXT_TOKEN_05_02wsc:SecurityContextTokenas defined by WS-SecureConversation specificationstatic javax.xml.namespace.QNameSECURITY_CONTEXT_TOKEN_05_12wsc:SecurityContextTokenas defined by WS-SecureConversation specification in WS-SXstatic javax.xml.namespace.QNameSIGNATUREds:Signatureas defined by XML Signature specification, enhanced by WS Security specificationstatic javax.xml.namespace.QNamesignatureConfirmationwsse11:signatureConfirmationas defined by OASIS WS Security specification,static javax.xml.namespace.QNametimeStampwsu:Timestampas defined by OASIS WS Security specification,static javax.xml.namespace.QNameusernameTokenwsse:UsernameTokenas defined by WS Security specificationstatic java.lang.StringVALUE_TYPE
-
Constructor Summary
Constructors Constructor Description WSSecurityEngine()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static WSSecurityEnginegetInstance()Get a singleton instance of security engine.java.util.VectorprocessSecurityHeader(org.w3c.dom.Document doc, java.lang.String actor, javax.security.auth.callback.CallbackHandler cb, Crypto crypto)Process the security header given the soap envelope as W3C document.java.util.VectorprocessSecurityHeader(org.w3c.dom.Document doc, java.lang.String actor, javax.security.auth.callback.CallbackHandler cb, Crypto sigCrypto, Crypto decCrypto)Process the security header given the soap envelope as W3C document.protected java.util.VectorprocessSecurityHeader(org.w3c.dom.Element securityHeader, javax.security.auth.callback.CallbackHandler cb, Crypto sigCrypto, Crypto decCrypto)Process the security header given thewsse:SecurityDOM Element.static voidsetWssConfig(WSSConfig wsc)
-
-
-
Field Detail
-
VALUE_TYPE
public static final java.lang.String VALUE_TYPE
- See Also:
- Constant Field Values
-
binaryToken
public static final javax.xml.namespace.QName binaryToken
wsse:BinarySecurityTokenas defined by WS Security specification
-
usernameToken
public static final javax.xml.namespace.QName usernameToken
wsse:UsernameTokenas defined by WS Security specification
-
timeStamp
public static final javax.xml.namespace.QName timeStamp
wsu:Timestampas defined by OASIS WS Security specification,
-
signatureConfirmation
public static final javax.xml.namespace.QName signatureConfirmation
wsse11:signatureConfirmationas defined by OASIS WS Security specification,
-
SIGNATURE
public static final javax.xml.namespace.QName SIGNATURE
ds:Signatureas defined by XML Signature specification, enhanced by WS Security specification
-
ENCRYPTED_KEY
public static final javax.xml.namespace.QName ENCRYPTED_KEY
xenc:EncryptedKeyas defined by XML Encryption specification, enhanced by WS Security specification
-
REFERENCE_LIST
public static final javax.xml.namespace.QName REFERENCE_LIST
xenc:ReferenceListas defined by XML Encryption specification,
-
SAML_TOKEN
public static final javax.xml.namespace.QName SAML_TOKEN
saml:Assertionas defined by SAML specification
-
DERIVED_KEY_TOKEN_05_02
public static final javax.xml.namespace.QName DERIVED_KEY_TOKEN_05_02
wsc:DerivedKeyTokenas defined by WS-SecureConversation specification
-
SECURITY_CONTEXT_TOKEN_05_02
public static final javax.xml.namespace.QName SECURITY_CONTEXT_TOKEN_05_02
wsc:SecurityContextTokenas defined by WS-SecureConversation specification
-
DERIVED_KEY_TOKEN_05_12
public static final javax.xml.namespace.QName DERIVED_KEY_TOKEN_05_12
wsc:DerivedKeyTokenas defined by WS-SecureConversation specification in WS-SX
-
SECURITY_CONTEXT_TOKEN_05_12
public static final javax.xml.namespace.QName SECURITY_CONTEXT_TOKEN_05_12
wsc:SecurityContextTokenas defined by WS-SecureConversation specification in WS-SX
-
-
Method Detail
-
getInstance
public static WSSecurityEngine getInstance()
Get a singleton instance of security engine.- Returns:
- ws-security engine.
-
setWssConfig
public static void setWssConfig(WSSConfig wsc)
- Parameters:
wsc- set the static WSSConfig to other than default
-
processSecurityHeader
public java.util.Vector processSecurityHeader(org.w3c.dom.Document doc, java.lang.String actor, javax.security.auth.callback.CallbackHandler cb, Crypto crypto) throws WSSecurityExceptionProcess the security header given the soap envelope as W3C document. This is the main entry point to verify or decrypt a SOAP enevelope. First check if awsse:Securityis availabe with the defined actor.- Parameters:
doc- the SOAP envelope asDocumentactor- the engine works on behalf of thisactor. Refer to the SOAP specification aboutactororrolecb- a callback hander to the caller to resolve passwords during encryption andUsernameTokenhandlingcrypto- the object that implements the access to the keystore and the handling of certificates.- Returns:
- a result vector
- Throws:
WSSecurityException- See Also:
processSecurityHeader(Element securityHeader, CallbackHandler cb,Crypto sigCrypto, Crypto decCrypto)
-
processSecurityHeader
public java.util.Vector processSecurityHeader(org.w3c.dom.Document doc, java.lang.String actor, javax.security.auth.callback.CallbackHandler cb, Crypto sigCrypto, Crypto decCrypto) throws WSSecurityExceptionProcess the security header given the soap envelope as W3C document. This is the main entry point to verify or decrypt a SOAP enevelope. First check if awsse:Securityis availabe with the defined actor.- Parameters:
doc- the SOAP envelope asDocumentactor- the engine works on behalf of thisactor. Refer to the SOAP specification aboutactororrolecb- a callback hander to the caller to resolve passwords during encryption andUsernameTokenhandlingsigCrypto- the object that implements the access to the keystore and the handling of certificates for SignaturedecCrypto- the object that implements the access to the keystore and the handling of certificates for Decryption- Returns:
- a result vector
- Throws:
WSSecurityException- See Also:
processSecurityHeader(Element securityHeader, CallbackHandler cb,Crypto sigCrypto, Crypto decCrypto)
-
processSecurityHeader
protected java.util.Vector processSecurityHeader(org.w3c.dom.Element securityHeader, javax.security.auth.callback.CallbackHandler cb, Crypto sigCrypto, Crypto decCrypto) throws WSSecurityExceptionProcess the security header given thewsse:SecurityDOM Element. This function loops over all direct child elements of thewsse:Securityheader. If it finds a knwon 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:Securityelement. This is in accordance to the WS Security specification. Currently the functions can handle the following child elements:- Parameters:
securityHeader- thewsse:Securityheader elementcb- a callback hander to the caller to resolve passwords during encryption andUsernameTokenhandlingsigCrypto- the object that implements the access to the keystore and the handling of certificates used for SignaturedecCrypto- the object that implements the access to the keystore and the handling of certificates used for Decryption- Returns:
- a Vector of
WSSecurityEngineResult. Each element in the the Vector represents the result of a security action. The elements are ordered according to the sequence of the security actions in the wsse:Signature header. The Vector maybe empty if no security processing was performed. - Throws:
WSSecurityException
-
-