de.flexiprovider.core.saferplus
Class SAFERPlusKey

java.lang.Object
  |
  +--de.flexiprovider.core.saferplus.SAFERPlusKey
All Implemented Interfaces:
java.security.Key, Key, SecretKey, javax.crypto.SecretKey, java.io.Serializable

public class SAFERPlusKey
extends java.lang.Object
implements SecretKey

This Class provides a Key for the algorithm SAFER+. It manages the keymaterial and assures that Instances of SAFERPlusKey may be compared and hashed according to the value of the key.

Author:
Martin Strese, Marcus Lippert
See Also:
Serialized Form

Fields inherited from interface java.security.Key
serialVersionUID
 
Constructor Summary
protected SAFERPlusKey(byte[] keyBytes)
          Construct a new SAFER+ key from the given key bytes.
 
Method Summary
 boolean equals(java.lang.Object other)
          Compare this key with another object.
 java.lang.String getAlgorithm()
          Return the name of the algorithm the key is used with.
 byte[] getEncoded()
           
 java.lang.String getFormat()
          Return the encoding format of this key.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAFERPlusKey

protected SAFERPlusKey(byte[] keyBytes)
Construct a new SAFER+ key from the given key bytes.
Parameters:
keyBytes - the key bytes
Method Detail

getAlgorithm

public java.lang.String getAlgorithm()
Return the name of the algorithm the key is used with.
Specified by:
getAlgorithm in interface java.security.Key
Returns:
"SAFER+"

getEncoded

public byte[] getEncoded()
Specified by:
getEncoded in interface java.security.Key
Returns:
a copy of the key bytes

getFormat

public java.lang.String getFormat()
Return the encoding format of this key.
Specified by:
getFormat in interface java.security.Key
Returns:
"RAW"

equals

public boolean equals(java.lang.Object other)
Compare this key with another object.
Overrides:
equals in class java.lang.Object
Parameters:
other - the other object
Returns:
the result of the comparison

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
the hash code of this key