javax.crypto.spec
Class RC2ParameterSpec

java.lang.Object
  |
  +--javax.crypto.spec.RC2ParameterSpec
All Implemented Interfaces:
AlgorithmParameterSpec

public class RC2ParameterSpec
extends Object
implements AlgorithmParameterSpec

RC2 parameter specification.


Attention:  This is not a SUN implementation!

This class has been developed by IAIK according to the documentation publically available.
For SUNīs documentation of this class see http://java.sun.com/security/JCE1.2/spec/apidoc/index.html


This class represents an initialization vector (IV), used as parameter by the RC2 algorithm.

Version:
File Revision 18
See Also:
AlgorithmParameterSpec

Constructor Summary
RC2ParameterSpec(int effectiveKeyBits)
          Creates a RC2ParametersSpec from the given effectiveKeyBits value.
RC2ParameterSpec(int effectiveKeyBits, byte[] initVector)
          Creates a RC2 Parameter specification by using the first 8 bytes of the supplied byte array as initialization vector (IV).
RC2ParameterSpec(int effectiveKeyBits, byte[] initVector, int offset)
          Creates a RC2 Parameter specification by using 8 bytes of the supplied byte array as IV, beginning at the given offset.
 
Method Summary
 boolean equals(Object otherObject)
          This object and the other object are considered equal if the other object is an instance of this class and if their effective key sizes and IVs are equal (they are also considered equal if both are null).
 int getEffectiveKeyBits()
          Return the number of effective key bits.
 byte[] getIV()
          Returns a copy of the initialization vector (IV) as byte array representation.
 int hashCode()
          Calculate a hash code for this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RC2ParameterSpec

public RC2ParameterSpec(int effectiveKeyBits)
Creates a RC2ParametersSpec from the given effectiveKeyBits value.
Parameters:
effectiveKeyBits - the number of effective key bits

RC2ParameterSpec

public RC2ParameterSpec(int effectiveKeyBits,
                        byte[] initVector)
Creates a RC2 Parameter specification by using the first 8 bytes of the supplied byte array as initialization vector (IV).
Parameters:
effectiveKeyBits - the number of effective key bits
initVector - the byte array holding the IV

RC2ParameterSpec

public RC2ParameterSpec(int effectiveKeyBits,
                        byte[] initVector,
                        int offset)
Creates a RC2 Parameter specification by using 8 bytes of the supplied byte array as IV, beginning at the given offset.
Parameters:
effectiveKeyBits - the number of effective key bits
initVector - the byte array holding the IV
offset - the offset indicating the start position within the input IV byte array
Method Detail

getEffectiveKeyBits

public int getEffectiveKeyBits()
Return the number of effective key bits.

getIV

public byte[] getIV()
Returns a copy of the initialization vector (IV) as byte array representation.
Returns:
a copy of the initialization vector (IV) as byte array representation

equals

public boolean equals(Object otherObject)
This object and the other object are considered equal if the other object is an instance of this class and if their effective key sizes and IVs are equal (they are also considered equal if both are null).
Overrides:
equals in class Object
Parameters:
otherObject - The other object for comparison.
Returns:
true, if effective key sizes and IVs are equal. false, otherwise.

hashCode

public int hashCode()
Calculate a hash code for this object. Includes the effective key size and the IV if present.
Overrides:
hashCode in class Object
Returns:
A hash code for this object.

This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note).

IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK