Package org.apache.wss4j.common.token
Class BinarySecurity
- java.lang.Object
-
- org.apache.wss4j.common.token.BinarySecurity
-
- Direct Known Subclasses:
KerberosSecurity
,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 void
addWSSENamespace()
Add the WSSE Namespace to this BST.void
addWSUNamespace()
Add the WSU Namespace to this BST.void
encodeRawToken()
BASE64-Encode the raw token bytes + store them in a text child node.boolean
equals(Object object)
CallbackHandler
getAttachmentCallbackHandler()
Element
getElement()
return the dom element.String
getEncodingType()
get the encoding type.String
getID()
get the id.byte[]
getToken()
get the byte array containing token information.String
getValueType()
get the value type.int
hashCode()
boolean
isStoreBytesInAttachment()
void
setAttachmentCallbackHandler(CallbackHandler attachmentCallbackHandler)
void
setEncodingType(String encoding)
set the encoding type.void
setID(String id)
set the id.void
setRawToken(byte[] data)
Set the raw token data, without Base-64 encoding it into the Element.void
setStoreBytesInAttachment(boolean storeBytesInAttachment)
void
setToken(byte[] data)
set the token information.void
setValueType(String type)
set the value type.String
toString()
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 WSSecurityException
set 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)
-
-