Class DerivedKeyToken
- java.lang.Object
-
- org.apache.ws.security.message.token.DerivedKeyToken
-
public class DerivedKeyToken extends java.lang.Object- Version:
- 1.0
- Author:
- Ruchith Fernando
-
-
Field Summary
Fields Modifier and Type Field Description protected org.w3c.dom.Elementelementprotected org.w3c.dom.ElementelementGenerationprotected org.w3c.dom.ElementelementLabelprotected org.w3c.dom.ElementelementLengthprotected org.w3c.dom.ElementelementNonceprotected org.w3c.dom.ElementelementOffsetprotected org.w3c.dom.ElementelementPropertiesprotected org.w3c.dom.ElementelementSecurityTokenReference
-
Constructor Summary
Constructors Constructor Description DerivedKeyToken(int version, org.w3c.dom.Document doc)This will create an empty DerivedKeyTokenDerivedKeyToken(org.w3c.dom.Document doc)This will create an empty DerivedKeyTokenDerivedKeyToken(org.w3c.dom.Element elem)This will create a DerivedKeyToken object with the given DErivedKeyToken element
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAlgorithm()Gets the derivattion algorithmorg.w3c.dom.ElementgetElement()Returns the dom element of thisSecurityContextTokenobject.intgetGeneration()java.lang.StringgetID()Gets the id.java.lang.StringgetLabel()Returns the label of the derived key tokenintgetLength()java.lang.StringgetNonce()Return the nonce of the derived key tokenintgetOffset()java.util.HashtablegetProperties()SecurityTokenReferencegetSecuityTokenReference()Returns the SecurityTokenReference of the derived key tokenvoidsetAlgorithm(java.lang.String algo)Set the derivattion algorithm of this derived key token.voidsetGeneration(int generation)Sets the generation of the derived keyvoidsetID(java.lang.String id)Set the id of this derived key token.voidsetLabel(java.lang.String label)Sets the label of the derived keyvoidsetLength(int length)Sets the length of the derived keyvoidsetNonce(java.lang.String nonce)Sets the nonce value of the derived keyvoidsetOffset(int offset)Sets the offsetvoidsetProperties(java.lang.String name, java.lang.String label, java.lang.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 thePropertieselement.voidsetProperties(java.util.Hashtable properties)If there are other types of properties other than Name, Label and Nonce This is provided for extensibility purposesvoidsetSecuityTokenReference(SecurityTokenReference ref)Sets the security token reference of the derived key token This is the reference to the shared secret used in the conversation/contextvoidsetSecuityTokenReference(org.w3c.dom.Element elem)java.lang.StringtoString()Returns the string representation of the token.
-
-
-
Field Detail
-
element
protected org.w3c.dom.Element element
-
elementSecurityTokenReference
protected org.w3c.dom.Element elementSecurityTokenReference
-
elementProperties
protected org.w3c.dom.Element elementProperties
-
elementGeneration
protected org.w3c.dom.Element elementGeneration
-
elementOffset
protected org.w3c.dom.Element elementOffset
-
elementLength
protected org.w3c.dom.Element elementLength
-
elementLabel
protected org.w3c.dom.Element elementLabel
-
elementNonce
protected org.w3c.dom.Element elementNonce
-
-
Constructor Detail
-
DerivedKeyToken
public DerivedKeyToken(org.w3c.dom.Document doc) throws org.apache.ws.security.conversation.ConversationExceptionThis will create an empty DerivedKeyToken- Parameters:
doc- THe DOM document- Throws:
org.apache.ws.security.conversation.ConversationException
-
DerivedKeyToken
public DerivedKeyToken(int version, org.w3c.dom.Document doc) throws org.apache.ws.security.conversation.ConversationExceptionThis will create an empty DerivedKeyToken- Parameters:
doc- THe DOM document- Throws:
org.apache.ws.security.conversation.ConversationException
-
DerivedKeyToken
public DerivedKeyToken(org.w3c.dom.Element elem) throws WSSecurityExceptionThis 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 Detail
-
setSecuityTokenReference
public void setSecuityTokenReference(SecurityTokenReference ref)
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
public void setSecuityTokenReference(org.w3c.dom.Element elem)
-
getSecuityTokenReference
public SecurityTokenReference getSecuityTokenReference() throws WSSecurityException
Returns the SecurityTokenReference of the derived key token- Returns:
- Throws:
WSSecurityException
-
setProperties
public void setProperties(java.lang.String name, java.lang.String label, java.lang.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 thePropertieselement. 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
public void setProperties(java.util.Hashtable properties)
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
public java.util.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.ConversationExceptionSets 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.ConversationExceptionSets 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
public void setLabel(java.lang.String label)
Sets the label of the derived key- Parameters:
label- Label value as a string
-
setNonce
public void setNonce(java.lang.String nonce)
Sets the nonce value of the derived key- Parameters:
nonce- Nonce value as a string
-
getLabel
public java.lang.String getLabel()
Returns the label of the derived key token- Returns:
- Label of the derived key token
-
getNonce
public java.lang.String getNonce()
Return the nonce of the derived key token- Returns:
- Nonce of the derived key token
-
getElement
public org.w3c.dom.Element getElement()
Returns the dom element of thisSecurityContextTokenobject.- Returns:
- the DerivedKeyToken element
-
toString
public java.lang.String toString()
Returns the string representation of the token.- Overrides:
toStringin classjava.lang.Object- Returns:
- a XML string representation
-
getID
public java.lang.String getID()
Gets the id.- Returns:
- the value of the
wsu:Idattribute of this DerivedKeyToken
-
setID
public void setID(java.lang.String id)
Set the id of this derived key token.- Parameters:
id- the value for thewsu:Idattribute of this DerivgedKeyToken
-
getAlgorithm
public java.lang.String getAlgorithm()
Gets the derivattion algorithm- Returns:
- the value of the
wsc:Algorithmattribute of this DerivedKeyToken
-
setAlgorithm
public void setAlgorithm(java.lang.String algo)
Set the derivattion algorithm of this derived key token.- Parameters:
derivattion- algorithm the value for thewsu:Algorithmattribute of this DerivgedKeyToken
-
-