AXL Software

com.theorem.radserver3.radutil
Class TempSecretKey

Object
  extended byTempSecretKey
All Implemented Interfaces:
Key, SecretKey, Serializable

public class TempSecretKey
extends Object
implements SecretKey

Class to hold temporary key information with no particular type associated with it.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface Key
serialVersionUID
 
Constructor Summary
TempSecretKey(byte[] key)
          Constructor for a byte array.
TempSecretKey(char[] key)
          Constructor for a character array.
 
Method Summary
 void clear()
          Clear the key material.
 boolean equals(Object o)
          See if this key is equal to another key.
 String getAlgorithm()
          Get the algorithm - always returns "None".
 byte[] getEncoded()
          No encoding, gets the raw value.
 String getFormat()
          Get format,
 int hashCode()
          Return the hash code for this key.
 String toString()
          String representation of the key.
 
Methods inherited from class Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TempSecretKey

public TempSecretKey(byte[] key)
Constructor for a byte array.

Parameters:
key - Key material.

TempSecretKey

public TempSecretKey(char[] key)
Constructor for a character array. Note: This will leave the key material around in other classes.

Parameters:
key - Key material.
Method Detail

clear

public void clear()
Clear the key material.

The key material will be destroyed by the finalizer, if it runs. This explicitly clears the key.


equals

public boolean equals(Object o)
See if this key is equal to another key.

Parameters:
o - Object to compare.

getAlgorithm

public String getAlgorithm()
Get the algorithm - always returns "None".

Specified by:
getAlgorithm in interface Key
Returns:
algorithm of "None".

getEncoded

public byte[] getEncoded()
No encoding, gets the raw value.

Specified by:
getEncoded in interface Key
Returns:
The key.

getFormat

public String getFormat()
Get format,

Specified by:
getFormat in interface Key
Returns:
"RAW".

hashCode

public int hashCode()
Return the hash code for this key. The hash code is calculated the same way String does:

s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]

Returns:
hash code.

toString

public String toString()
String representation of the key.

Returns:
representation.

AXL Software

Submit a bug report or feature request

Copyright 1998-2010 AXL Software PO Box 97, Viola, Delaware 19979, U.S.A. All Rights Reserved.