Package org.apache.wss4j.dom.message
Class WSSecBase
java.lang.Object
org.apache.wss4j.dom.message.WSSecBase
- Direct Known Subclasses:
WSSecEncryptedKey,WSSecSAMLToken,WSSecSignatureBase,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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected CallbackHandlerprotected CallbackLookupprotected booleanprotected intprotected Stringprotected booleanprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclean()protected DocumentintGets the value of thekeyIdentifierType.getParts()Get which parts of the message to encrypt/sign.booleanvoidsetAttachmentCallbackHandler(CallbackHandler attachmentCallbackHandler) protected StringLooks up or adds a body id.voidsetCallbackLookup(CallbackLookup callbackLookup) voidsetExpandXopInclude(boolean expandXopInclude) voidsetIdAllocator(WsuIdAllocator idAllocator) voidsetKeyIdentifierType(int keyIdType) Sets which key identifier to use.voidsetStoreBytesInAttachment(boolean storeBytesInAttachment) voidsetUserInfo(String user, String password) Set the user and password info.voidsetWsDocInfo(WSDocInfo wsDocInfo) protected String
-
Field Details
-
user
-
password
-
keyIdentifierType
protected int keyIdentifierType -
callbackLookup
-
attachmentCallbackHandler
-
storeBytesInAttachment
protected boolean storeBytesInAttachment -
expandXopInclude
protected boolean expandXopInclude -
addWSUNamespace
protected boolean addWSUNamespace
-
-
Constructor Details
-
WSSecBase
-
WSSecBase
-
-
Method Details
-
getDocument
-
getSecurityHeader
-
setCallbackLookup
- Parameters:
callbackLookup- The CallbackLookup object to retrieve elements
-
getParts
Get which parts of the message to encrypt/sign. -
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. -
getKeyIdentifierType
public int getKeyIdentifierType()Gets the value of thekeyIdentifierType.- Returns:
- The
keyIdentifyerType. - See Also:
-
setAttachmentCallbackHandler
-
setStoreBytesInAttachment
public void setStoreBytesInAttachment(boolean storeBytesInAttachment) -
setBodyID
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 method 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:
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
-
getIdAllocator
-
setIdAllocator
-
isExpandXopInclude
public boolean isExpandXopInclude() -
setExpandXopInclude
public void setExpandXopInclude(boolean expandXopInclude) -
getWsDocInfo
-
setWsDocInfo
-
clean
public void clean()
-