The parameters consist of an effective key size and optionally an 8-byte initialization vector (IV) (only in feedback mode).
This class can be used to initialize a Cipher
object that
implements the RC2 algorithm.
Modifier and Type | Field and Description |
---|---|
private final int | |
private byte[] |
Access | Constructor and Description |
---|---|
public | RC2ParameterSpec(int
the effective key size in bits. effectiveKeyBits)Constructs a parameter set for RC2 from the given effective key size (in bits). |
public | RC2ParameterSpec(int
the effective key size in bits. effectiveKeyBits, byte[] the buffer with the 8-byte IV. The first 8 bytes of
the buffer are copied to protect against subsequent modification. iv)Constructs a parameter set for RC2 from the given effective key size (in bits) and an 8-byte IV. |
public | RC2ParameterSpec(int
the effective key size in bits. effectiveKeyBits, byte[] the buffer with the IV. The first 8 bytes
of the buffer beginning at iv, int offset inclusive
are copied to protect against subsequent modification.the offset in offset)iv where the 8-byte IV
starts.Constructs a parameter set for RC2 from the given effective key size (in bits) and IV. |
Modifier and Type | Method and Description |
---|---|
public boolean | Returns: true if the objects are considered equal, false ifobj is null or otherwise.the object to test for equality with this object. obj)Overrides java. Tests for equality between the specified object and this object. |
public int | Returns: the effective key size in bits.Returns the effective key size in bits. |
public byte[] | Returns: the IV or null if this parameter set does not contain an IV. Returns a new array each time this method is called.Returns the IV or null if this parameter set does not contain an IV. |
public int |
effectiveKeyBits | back to summary |
---|---|
private final int effectiveKeyBits |
iv | back to summary |
---|---|
private byte[] iv |
RC2ParameterSpec | back to summary |
---|---|
public RC2ParameterSpec(int effectiveKeyBits) Constructs a parameter set for RC2 from the given effective key size (in bits).
|
RC2ParameterSpec | back to summary |
---|---|
public RC2ParameterSpec(int effectiveKeyBits, byte[] iv) Constructs a parameter set for RC2 from the given effective key size (in bits) and an 8-byte IV. The bytes that constitute the IV are those between
|
RC2ParameterSpec | back to summary |
---|---|
public RC2ParameterSpec(int effectiveKeyBits, byte[] iv, int offset) Constructs a parameter set for RC2 from the given effective key size (in bits) and IV. The IV is taken from
|
equals | back to summary |
---|---|
public boolean equals(Object obj) Overrides java. Tests for equality between the specified object and this
object. Two RC2ParameterSpec objects are considered equal if their
effective key sizes and IVs are equal.
(Two IV references are considered equal if both are |
getEffectiveKeyBits | back to summary |
---|---|
public int getEffectiveKeyBits() Returns the effective key size in bits.
|
getIV | back to summary |
---|---|
public byte[] getIV() Returns the IV or null if this parameter set does not contain an IV.
|
hashCode | back to summary |
---|---|
public int hashCode() Overrides java. Calculates a hash code value for the object. Objects that are equal will also have the same hashcode.
|