de.flexiprovider.core.rc2
Class RC2Key

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

public class RC2Key
extends java.lang.Object
implements SecretKey

RC2Key is used to store a symmetric Key for RC2 Encryption/Decryption.

Author:
Oliver Seiler
See Also:
Serialized Form

Fields inherited from interface java.security.Key
serialVersionUID
 
Constructor Summary
protected RC2Key(byte[] keyBytes)
          Construct a new RC2 key using the supplied 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()
          Return the name of the algorithm the key is used for.
 byte[] getEncoded()
           
 java.lang.String getFormat()
          Return the format of the stored key.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RC2Key

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

getAlgorithm

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

getFormat

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

getEncoded

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

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