Package org.apache.ws.security.message
Class WSBaseMessage
- java.lang.Object
-
- org.apache.ws.security.message.WSBaseMessage
-
- Direct Known Subclasses:
WSAddSignatureConfirmation,WSAddTimestamp,WSEncryptBody,WSSAddSAMLToken,WSSAddUsernameToken,WSSignEnvelope
public class WSBaseMessage extends java.lang.ObjectThis is the base class for WS Security messages. It provides common functions and fields used by the specific message classes such as sign, encrypt, and username token.- Author:
- Werner Dittmann (Werner.Dittmann@t-online.de)
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Stringactorprotected booleandoDebugprotected intkeyIdentifierTypeprotected booleanmustunderstandprotected java.util.Vectorpartsprotected java.lang.Stringpasswordprotected inttimeToLiveprotected java.lang.Stringuserprotected WSSConfigwssConfig
-
Constructor Summary
Constructors Constructor Description WSBaseMessage()Deprecated.replaced byWSSecBase()WSBaseMessage(java.lang.String actor)Deprecated.replaced byWSSecBase()andWSSecHeaderfor actor specification.WSBaseMessage(java.lang.String actor, boolean mu)Deprecated.replaced byWSSecBase()andWSSecHeaderfor actor and mustunderstand specification.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intgetKeyIdentifierType()Deprecated.replaced byWSSecBase.getKeyIdentifierType()protected org.w3c.dom.ElementinsertSecurityHeader(org.w3c.dom.Document doc)Deprecated.replaced byWSSecHeader.insertSecurityHeader(Document)voidsetActor(java.lang.String act)Deprecated.replaced byWSSecHeader.setActor(String)protected java.lang.StringsetBodyID(org.w3c.dom.Document doc)Deprecated.replaced byWSSecBase.setBodyID(Document)voidsetKeyIdentifierType(int keyIdType)Deprecated.replaced byWSSecBase.setKeyIdentifierType(int)voidsetMustUnderstand(boolean mu)Deprecated.replaced byWSSecHeader.setMustUnderstand(boolean)voidsetParts(java.util.Vector parts)Deprecated.replaced byWSSecBase.setParts(Vector)voidsetTimeToLive(int ttl)Deprecated.replaced byWSSecTimestamp.setTimeToLive(int)voidsetUserInfo(java.lang.String user, java.lang.String password)Deprecated.replaced byWSSecBase.setUserInfo(String, String)voidsetWsConfig(WSSConfig wsConfig)Deprecated.replaced byWSSecBase.setWsConfig(WSSConfig)protected java.lang.StringsetWsuId(org.w3c.dom.Element bodyElement)
-
-
-
Field Detail
-
actor
protected java.lang.String actor
-
mustunderstand
protected boolean mustunderstand
-
user
protected java.lang.String user
-
password
protected java.lang.String password
-
keyIdentifierType
protected int keyIdentifierType
-
parts
protected java.util.Vector parts
-
timeToLive
protected int timeToLive
-
doDebug
protected boolean doDebug
-
wssConfig
protected WSSConfig wssConfig
-
-
Constructor Detail
-
WSBaseMessage
public WSBaseMessage()
Deprecated.replaced byWSSecBase()Constructor.
-
WSBaseMessage
public WSBaseMessage(java.lang.String actor)
Deprecated.replaced byWSSecBase()andWSSecHeaderfor actor specification.Constructor.- Parameters:
actor- The actor name of thewsse:Securityheader
-
WSBaseMessage
public WSBaseMessage(java.lang.String actor, boolean mu)Deprecated.replaced byWSSecBase()andWSSecHeaderfor actor and mustunderstand specification.Constructor.- Parameters:
actor- The actor name of thewsse:Securityheadermu- SetmustUnderstandto true or false
-
-
Method Detail
-
setActor
public void setActor(java.lang.String act)
Deprecated.replaced byWSSecHeader.setActor(String)set actor name.- Parameters:
act- The actor name of thewsse:Securityheader
-
setTimeToLive
public void setTimeToLive(int ttl)
Deprecated.replaced byWSSecTimestamp.setTimeToLive(int)Set the time to live. This is the time difference in seconds between theCreatedand theExpiresinTimestamp.- Parameters:
ttl- The time to live in second
-
setParts
public void setParts(java.util.Vector parts)
Deprecated.replaced byWSSecBase.setParts(Vector)Set which parts of the message to encrypt/sign.- Parameters:
parts- The vector containing the WSEncryptionPart objects
-
setMustUnderstand
public void setMustUnderstand(boolean mu)
Deprecated.replaced byWSSecHeader.setMustUnderstand(boolean)Set themustUnderstandflag for thewsse:Securityheader- Parameters:
mu- SetmustUnderstandto true or false
-
setKeyIdentifierType
public void setKeyIdentifierType(int keyIdType)
Deprecated.replaced byWSSecBase.setKeyIdentifierType(int)Sets which key identifier to use. Defines the key identifier type to use in thesignatureor theecnryptionfunction to set up the key identification elements.- Parameters:
keyIdType-- See Also:
WSConstants.ISSUER_SERIAL,WSConstants.BST_DIRECT_REFERENCE,WSConstants.X509_KEY_IDENTIFIER,WSConstants.SKI_KEY_IDENTIFIER
-
getKeyIdentifierType
public int getKeyIdentifierType()
Deprecated.replaced byWSSecBase.getKeyIdentifierType()Gets the value of thekeyIdentifyerType.- Returns:
- The
keyIdentifyerType. - See Also:
WSConstants.ISSUER_SERIAL,WSConstants.BST_DIRECT_REFERENCE,WSConstants.X509_KEY_IDENTIFIER,WSConstants.SKI_KEY_IDENTIFIER
-
setWsConfig
public void setWsConfig(WSSConfig wsConfig)
Deprecated.replaced byWSSecBase.setWsConfig(WSSConfig)- Parameters:
wsConfig- The wsConfig to set.
-
setBodyID
protected java.lang.String setBodyID(org.w3c.dom.Document doc) throws java.lang.ExceptionDeprecated.replaced byWSSecBase.setBodyID(Document)Looks up or adds a body id. First try to locate thewsu:Idin the SOAP body element. If one is found, the value of thewsu:Idattribute is returned. Otherwise the methode generates a newwsu:Idand an appropriate value.- Parameters:
doc- The SOAP envelope asDocument- Returns:
- The value of the
wsu:Idattribute of the SOAP body - Throws:
java.lang.Exception
-
setWsuId
protected java.lang.String setWsuId(org.w3c.dom.Element bodyElement)
-
setUserInfo
public void setUserInfo(java.lang.String user, java.lang.String password)Deprecated.replaced byWSSecBase.setUserInfo(String, String)Set the user and password info. Both information is used to get the user's private signing key.- Parameters:
user- This is the user's alias name in the keystore that identifies the private key to sign the documentpassword- The user's password to get the private signing key from the keystore
-
insertSecurityHeader
protected org.w3c.dom.Element insertSecurityHeader(org.w3c.dom.Document doc)
Deprecated.replaced byWSSecHeader.insertSecurityHeader(Document)Creates a security header and inserts it as child into the SOAP Envelope. Check if a WS Security header block for an actor is already available in the document. If a header block is found return it, otherwise a new wsse:Security header block is created and the attributes set- Parameters:
doc- A SOAP envelope asDocument- Returns:
- A
wsse:Securityelement
-
-