Package org.apache.wss4j.common.token
Class BinarySecurity
java.lang.Object
org.apache.wss4j.common.token.BinarySecurity
- Direct Known Subclasses:
PKIPathSecurity,X509Security
Binary Security Token.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBinarySecurity(CallbackHandler callbackHandler) Create a BinarySecurityToken via a CallbackHandlerBinarySecurity(Document doc) Constructor.BinarySecurity(Element elem, BSPEnforcer bspEnforcer) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the WSSE Namespace to this BST.voidAdd the WSU Namespace to this BST.voidBASE64-Encode the raw token bytes + store them in a text child node.booleanreturn the dom element.get the encoding type.getID()get the id.byte[]getToken()get the byte array containing token information.get the value type.inthashCode()booleanvoidsetAttachmentCallbackHandler(CallbackHandler attachmentCallbackHandler) voidsetEncodingType(String encoding) set the encoding type.voidset 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.toString()return the string representation of the token.
-
Field Details
-
TOKEN_BST
-
TOKEN_KI
-
-
Constructor Details
-
BinarySecurity
Constructor.- Parameters:
elem- The BinarySecurityToken element to processbspEnforcer- a BSPEnforcer instance to enforce BSP rules- Throws:
WSSecurityException
-
BinarySecurity
Constructor.- Parameters:
doc-
-
BinarySecurity
Create a BinarySecurityToken via a CallbackHandler- Parameters:
callbackHandler-- Throws:
WSSecurityException
-
-
Method Details
-
getAttachmentCallbackHandler
-
setAttachmentCallbackHandler
-
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
get the value type.- Returns:
- the value type
-
setValueType
set the value type.- Parameters:
type-
-
getEncodingType
get the encoding type.- Returns:
- the encoding type.
-
setEncodingType
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
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
return the dom element.- Returns:
- the dom element.
-
getID
get the id.- Returns:
- the WSU ID of this element
-
setID
set the id.- Parameters:
id-
-
toString
return the string representation of the token. -
hashCode
public int hashCode() -
equals
-
isStoreBytesInAttachment
public boolean isStoreBytesInAttachment() -
setStoreBytesInAttachment
public void setStoreBytesInAttachment(boolean storeBytesInAttachment)
-