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
This 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)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the value of thekeyIdentifyerType
.protected String
Looks up or adds a body id.void
setKeyIdentifierType
(int keyIdType) Sets which key identifier to use.void
Set which parts of the message to encrypt/sign.void
setUserInfo
(String user, String password) Set the user and password info.void
setWsConfig
(WSSConfig wsConfig) protected String
-
Field Details
-
user
-
password
-
keyIdentifierType
protected int keyIdentifierType -
parts
-
doDebug
protected boolean doDebug -
wssConfig
-
-
Constructor Details
-
WSSecBase
public WSSecBase()Constructor.
-
-
Method Details
-
setParts
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 themethod
or themethod
function to set up the key identification elements.- Parameters:
keyIdType
-- See Also:
-
getKeyIdentifierType
public int getKeyIdentifierType()Gets the value of thekeyIdentifyerType
.- Returns:
- The
keyIdentifyerType
. - See Also:
-
setWsConfig
- Parameters:
wsConfig
- The wsConfig to set.
-
setBodyID
Looks up or adds a body id. First try to locate thewsu:Id
in the SOAP body element. If one is found, the value of thewsu:Id
attribute is returned. Otherwise the methode generates a newwsu:Id
and an appropriate value.- Parameters:
doc
- The SOAP envelope asDocument
- Returns:
- The value of the
wsu:Id
attribute of the SOAP body - Throws:
Exception
-
setWsuId
-
setUserInfo
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
-