Package org.apache.ws.security.message
Class WSSecBase
- java.lang.Object
-
- org.apache.ws.security.message.WSSecBase
-
- Direct Known Subclasses:
WSSecDerivedKeyBase,WSSecEncryptedKey,WSSecSAMLToken,WSSecSignature,WSSecSignatureConfirmation,WSSecTimestamp,WSSecUsernameToken
public class WSSecBase 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@apache.org)
-
-
Constructor Summary
Constructors Constructor Description WSSecBase()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetKeyIdentifierType()Gets the value of thekeyIdentifyerType.protected java.lang.StringsetBodyID(org.w3c.dom.Document doc)Looks up or adds a body id.voidsetKeyIdentifierType(int keyIdType)Sets which key identifier to use.voidsetParts(java.util.Vector parts)Set which parts of the message to encrypt/sign.voidsetUserInfo(java.lang.String user, java.lang.String password)Set the user and password info.voidsetWsConfig(WSSConfig wsConfig)protected java.lang.StringsetWsuId(org.w3c.dom.Element bodyElement)
-
-
-
Field Detail
-
user
protected java.lang.String user
-
password
protected java.lang.String password
-
keyIdentifierType
protected int keyIdentifierType
-
parts
protected java.util.Vector parts
-
doDebug
protected boolean doDebug
-
wssConfig
protected WSSConfig wssConfig
-
-
Method Detail
-
setParts
public void setParts(java.util.Vector parts)
Set which parts of the message to encrypt/sign.- Parameters:
parts- The vector containing the WSEncryptionPart objects
-
setKeyIdentifierType
public void setKeyIdentifierType(int keyIdType)
Sets which key identifier to use. Defines the key identifier type to use in themethodor themethodfunction 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()
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)
- Parameters:
wsConfig- The wsConfig to set.
-
setBodyID
protected java.lang.String setBodyID(org.w3c.dom.Document doc) throws java.lang.ExceptionLooks 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)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
-
-