org.apache.rahas
Class EncryptedKeyToken

java.lang.Object
  extended by org.apache.rahas.Token
      extended by org.apache.rahas.EncryptedKeyToken
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class EncryptedKeyToken
extends Token

This token is used store Encrypted Key Tokens. This token contains the SHA1 value of the Encrypted Key. These tokens are stored using the storage mechanism provided via the TokenStorage interface.

See Also:
TokenStorage, Serialized Form

Field Summary
 
Fields inherited from class org.apache.rahas.Token
CANCELLED, EXPIRED, ISSUED, RENEWED
 
Constructor Summary
EncryptedKeyToken()
           
EncryptedKeyToken(java.lang.String id, java.util.Date created, java.util.Date expires)
           
EncryptedKeyToken(java.lang.String id, org.apache.axiom.om.OMElement tokenElem, java.util.Date created, java.util.Date expires)
           
 
Method Summary
 java.lang.String getSHA1()
           
 void readExternal(java.io.ObjectInput in)
          Implementing de-serialization logic in accordance with the serialization logic.
 void setSHA1(java.lang.String sha)
           
 void writeExternal(java.io.ObjectOutput out)
          Implementing serialize logic according to our own protocol.
 
Methods inherited from class org.apache.rahas.Token
getAttachedReference, getCreated, getExpires, getId, getIssuerAddress, getPreviousToken, getProperties, getSecret, getState, getToken, getUnattachedReference, isChanged, setAttachedReference, setChanged, setExpires, setIssuerAddress, setPreviousToken, setProperties, setSecret, setState, setToken, setUnattachedReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EncryptedKeyToken

public EncryptedKeyToken()

EncryptedKeyToken

public EncryptedKeyToken(java.lang.String id,
                         java.util.Date created,
                         java.util.Date expires)

EncryptedKeyToken

public EncryptedKeyToken(java.lang.String id,
                         org.apache.axiom.om.OMElement tokenElem,
                         java.util.Date created,
                         java.util.Date expires)
                  throws TrustException
Throws:
TrustException
Method Detail

setSHA1

public void setSHA1(java.lang.String sha)
Parameters:
sha - SHA1 of the encrypted key

getSHA1

public java.lang.String getSHA1()
Returns:
SHA1 value of the encrypted key

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Description copied from class: Token
Implementing serialize logic according to our own protocol. We had to follow this, because OMElement class is not serializable. Making OMElement serializable will have an huge impact on other components. Therefore implementing serialization logic according to a manual protocol.

Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class Token
Parameters:
out - Stream which writes serialized bytes.
Throws:
java.io.IOException - If unable to serialize particular member.

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.lang.ClassNotFoundException,
                         java.io.IOException
Description copied from class: Token
Implementing de-serialization logic in accordance with the serialization logic.

Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class Token
Parameters:
in - Stream which used to read data.
Throws:
java.io.IOException - If unable to de-serialize particular data member.
java.lang.ClassNotFoundException