Package org.apache.wss4j.common.token
Class BinarySecurity
- java.lang.Object
-
- org.apache.wss4j.common.token.BinarySecurity
-
- Direct Known Subclasses:
PKIPathSecurity,X509Security
public class BinarySecurity extends Object
Binary Security Token.
-
-
Constructor Summary
Constructors Constructor Description BinarySecurity(CallbackHandler callbackHandler)Create a BinarySecurityToken via a CallbackHandlerBinarySecurity(Document doc)Constructor.BinarySecurity(Element elem, BSPEnforcer bspEnforcer)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddWSSENamespace()Add the WSSE Namespace to this BST.voidaddWSUNamespace()Add the WSU Namespace to this BST.voidencodeRawToken()BASE64-Encode the raw token bytes + store them in a text child node.booleanequals(Object object)CallbackHandlergetAttachmentCallbackHandler()ElementgetElement()return the dom element.StringgetEncodingType()get the encoding type.StringgetID()get the id.byte[]getToken()get the byte array containing token information.StringgetValueType()get the value type.inthashCode()booleanisStoreBytesInAttachment()voidsetAttachmentCallbackHandler(CallbackHandler attachmentCallbackHandler)voidsetEncodingType(String encoding)set the encoding type.voidsetID(String id)set the id.voidsetRawToken(byte[] data)Set the raw token data, without Base-64 encoding it into the Element.voidsetStoreBytesInAttachment(boolean storeBytesInAttachment)voidsetToken(byte[] data)set the token information.voidsetValueType(String type)set the value type.StringtoString()return the string representation of the token.
-
-
-
Constructor Detail
-
BinarySecurity
public BinarySecurity(Element elem, BSPEnforcer bspEnforcer) throws WSSecurityException
Constructor.- Parameters:
elem- The BinarySecurityToken element to processbspEnforcer- a BSPEnforcer instance to enforce BSP rules- Throws:
WSSecurityException
-
BinarySecurity
public BinarySecurity(Document doc)
Constructor.- Parameters:
doc-
-
BinarySecurity
public BinarySecurity(CallbackHandler callbackHandler) throws WSSecurityException
Create a BinarySecurityToken via a CallbackHandler- Parameters:
callbackHandler-- Throws:
WSSecurityException
-
-
Method Detail
-
getAttachmentCallbackHandler
public CallbackHandler getAttachmentCallbackHandler()
-
setAttachmentCallbackHandler
public void setAttachmentCallbackHandler(CallbackHandler attachmentCallbackHandler)
-
addWSSENamespace
public void addWSSENamespace()
Add the WSSE Namespace to this BST. The namespace is not added by default for efficiency purposes.
-
addWSUNamespace
public void addWSUNamespace()
Add the WSU Namespace to this BST. The namespace is not added by default for efficiency purposes.
-
getValueType
public String getValueType()
get the value type.- Returns:
- the value type
-
setValueType
public void setValueType(String type)
set the value type.- Parameters:
type-
-
getEncodingType
public String getEncodingType()
get the encoding type.- Returns:
- the encoding type.
-
setEncodingType
public void setEncodingType(String encoding)
set the encoding type.- Parameters:
encoding-
-
getToken
public byte[] getToken()
get the byte array containing token information.- Returns:
- the byte array containing token information
-
setToken
public void setToken(byte[] data) throws WSSecurityExceptionset the token information.- Parameters:
data-- Throws:
WSSecurityException
-
setRawToken
public void setRawToken(byte[] data)
Set the raw token data, without Base-64 encoding it into the Element.
-
encodeRawToken
public void encodeRawToken()
BASE64-Encode the raw token bytes + store them in a text child node.
-
getElement
public Element getElement()
return the dom element.- Returns:
- the dom element.
-
getID
public String getID()
get the id.- Returns:
- the WSU ID of this element
-
setID
public void setID(String id)
set the id.- Parameters:
id-
-
toString
public String toString()
return the string representation of the token.
-
isStoreBytesInAttachment
public boolean isStoreBytesInAttachment()
-
setStoreBytesInAttachment
public void setStoreBytesInAttachment(boolean storeBytesInAttachment)
-
-