Class DerivedKeyToken
java.lang.Object
org.apache.ws.security.message.token.DerivedKeyToken
- Version:
- 1.0
- Author:
- Ruchith Fernando
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDerivedKeyToken
(int version, Document doc) This will create an empty DerivedKeyTokenDerivedKeyToken
(Document doc) This will create an empty DerivedKeyTokenDerivedKeyToken
(Element elem) This will create a DerivedKeyToken object with the given DErivedKeyToken element -
Method Summary
Modifier and TypeMethodDescriptionGets the derivattion algorithmReturns the dom element of thisSecurityContextToken
object.int
getID()
Gets the id.getLabel()
Returns the label of the derived key tokenint
getNonce()
Return the nonce of the derived key tokenint
Returns the SecurityTokenReference of the derived key tokenvoid
setAlgorithm
(String algo) Set the derivattion algorithm of this derived key token.void
setGeneration
(int generation) Sets the generation of the derived keyvoid
Set the id of this derived key token.void
Sets the label of the derived keyvoid
setLength
(int length) Sets the length of the derived keyvoid
Sets the nonce value of the derived keyvoid
setOffset
(int offset) Sets the offsetvoid
setProperties
(String name, String label, String nonce) This is used to set the Name, Label and Nonce element values in the properties element At this point I'm not sure if these are the only properties that will appear in theProperties
element.void
setProperties
(Hashtable properties) If there are other types of properties other than Name, Label and Nonce This is provided for extensibility purposesvoid
Sets the security token reference of the derived key token This is the reference to the shared secret used in the conversation/contextvoid
toString()
Returns the string representation of the token.
-
Field Details
-
element
-
elementSecurityTokenReference
-
elementProperties
-
elementGeneration
-
elementOffset
-
elementLength
-
elementLabel
-
elementNonce
-
-
Constructor Details
-
DerivedKeyToken
public DerivedKeyToken(Document doc) throws org.apache.ws.security.conversation.ConversationException This will create an empty DerivedKeyToken- Parameters:
doc
- THe DOM document- Throws:
org.apache.ws.security.conversation.ConversationException
-
DerivedKeyToken
public DerivedKeyToken(int version, Document doc) throws org.apache.ws.security.conversation.ConversationException This will create an empty DerivedKeyToken- Parameters:
doc
- THe DOM document- Throws:
org.apache.ws.security.conversation.ConversationException
-
DerivedKeyToken
This will create a DerivedKeyToken object with the given DErivedKeyToken element- Parameters:
elem
- The DErivedKeyToken DOM element- Throws:
WSSecurityException
- If the element is not a derived key token
-
-
Method Details
-
setSecuityTokenReference
Sets the security token reference of the derived key token This is the reference to the shared secret used in the conversation/context- Parameters:
ref
- Security token reference
-
setSecuityTokenReference
-
getSecuityTokenReference
Returns the SecurityTokenReference of the derived key token- Returns:
- Throws:
WSSecurityException
-
setProperties
This is used to set the Name, Label and Nonce element values in the properties element At this point I'm not sure if these are the only properties that will appear in theProperties
element. There fore this method is provided If this is not required feel free to remove this :D- Parameters:
name
- Value of the Properties/Name elementlabel
- Value of the Properties/Label elementnonce
- Value of the Properties/Nonce element
-
setProperties
If there are other types of properties other than Name, Label and Nonce This is provided for extensibility purposes- Parameters:
properties
- The properties and values in a hashtable
-
getProperties
-
setLength
public void setLength(int length) Sets the length of the derived key- Parameters:
length
- The length of the derived key as a long
-
getLength
public int getLength() -
setOffset
public void setOffset(int offset) throws org.apache.ws.security.conversation.ConversationException Sets the offset- Parameters:
offset
- The offset value as an integer- Throws:
org.apache.ws.security.conversation.ConversationException
-
getOffset
public int getOffset() -
setGeneration
public void setGeneration(int generation) throws org.apache.ws.security.conversation.ConversationException Sets the generation of the derived key- Parameters:
generation
- generation value as an integer- Throws:
org.apache.ws.security.conversation.ConversationException
-
getGeneration
public int getGeneration() -
setLabel
Sets the label of the derived key- Parameters:
label
- Label value as a string
-
setNonce
Sets the nonce value of the derived key- Parameters:
nonce
- Nonce value as a string
-
getLabel
Returns the label of the derived key token- Returns:
- Label of the derived key token
-
getNonce
Return the nonce of the derived key token- Returns:
- Nonce of the derived key token
-
getElement
Returns the dom element of thisSecurityContextToken
object.- Returns:
- the DerivedKeyToken element
-
toString
Returns the string representation of the token. -
getID
Gets the id.- Returns:
- the value of the
wsu:Id
attribute of this DerivedKeyToken
-
setID
Set the id of this derived key token.- Parameters:
id
- the value for thewsu:Id
attribute of this DerivgedKeyToken
-
getAlgorithm
Gets the derivattion algorithm- Returns:
- the value of the
wsc:Algorithm
attribute of this DerivedKeyToken
-
setAlgorithm
Set the derivattion algorithm of this derived key token.- Parameters:
derivattion
- algorithm the value for thewsu:Algorithm
attribute of this DerivgedKeyToken
-