de.flexiprovider.core.mars
Class MARSKey

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

public class MARSKey
extends java.lang.Object
implements SecretKey

MARSKey is used to store a symmetric key for MARS encryption/decryption.

Author:
Katja Rauch
See Also:
Serialized Form

Fields inherited from interface java.security.Key
serialVersionUID
 
Constructor Summary
protected MARSKey(byte[] keyBytes)
          Construct a new key using the given key data.
 
Method Summary
 boolean equals(java.lang.Object other)
          Tests if the argument contains the same key material as this.
 java.lang.String getAlgorithm()
           
 byte[] getEncoded()
           
 java.lang.String getFormat()
           
 int hashCode()
           
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MARSKey

protected MARSKey(byte[] keyBytes)
Construct a new key using the given key data.
Parameters:
keyBytes - the key data
Method Detail

getAlgorithm

public java.lang.String getAlgorithm()
Specified by:
getAlgorithm in interface java.security.Key
Returns:
the name of the algorithm the key is used for

getFormat

public java.lang.String getFormat()
Specified by:
getFormat in interface java.security.Key
Returns:
the format of the encoded key

getEncoded

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

equals

public boolean equals(java.lang.Object other)
Tests if the argument contains the same key material as this.
Overrides:
equals in class java.lang.Object
Parameters:
other - comparing key material
Returns:
true if the keys are equal

hashCode

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