to top
Android APIs
public class

RC2ParameterSpec

extends Object
implements AlgorithmParameterSpec
java.lang.Object
   ↳ javax.crypto.spec.RC2ParameterSpec

Class Overview

The algorithm parameter specification for the RC2 algorithm.

Summary

Public Constructors
RC2ParameterSpec(int effectiveKeyBits)
Creates a new RC2ParameterSpec instance with the specified effective key length (in bits),
RC2ParameterSpec(int effectiveKeyBits, byte[] iv)
Creates a new RC2ParameterSpec instance with the specified effective key length (in bits) and initialization vector.
RC2ParameterSpec(int effectiveKeyBits, byte[] iv, int offset)
Creates a new RC2ParameterSpec instance with the specified effective key length (in bits) and initialization vector.
Public Methods
boolean equals(Object obj)
Compares the specified object to this RC2ParameterSpec instance.
int getEffectiveKeyBits()
Returns the effective key length (in bits).
byte[] getIV()
Returns a copy of the initialization vector.
int hashCode()
Returns the hash code of this RC2ParameterSpec instance.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public RC2ParameterSpec (int effectiveKeyBits)

Since: API Level 1

Creates a new RC2ParameterSpec instance with the specified effective key length (in bits),

Parameters
effectiveKeyBits the effective key length (in bits).

public RC2ParameterSpec (int effectiveKeyBits, byte[] iv)

Since: API Level 1

Creates a new RC2ParameterSpec instance with the specified effective key length (in bits) and initialization vector.

The size of the initialization vector must be at least 8 bytes which are copied to protect them against modification.

Parameters
effectiveKeyBits the effective key length (in bits).
iv the initialization vector.
Throws
IllegalArgumentException if the initialization vector is null or shorter than 8 bytes.

public RC2ParameterSpec (int effectiveKeyBits, byte[] iv, int offset)

Since: API Level 1

Creates a new RC2ParameterSpec instance with the specified effective key length (in bits) and initialization vector.

The size of the initialization vector starting at offset must be at least 8 bytes which are copied to protect them against modification.

Parameters
effectiveKeyBits the effective key length (in bits).
iv the initialization vector.
offset the offset in the initialization vector to start at.
Throws
IllegalArgumentException if the initialization vector is null or starting at offset is shorter than 8 bytes.

Public Methods

public boolean equals (Object obj)

Since: API Level 1

Compares the specified object to this RC2ParameterSpec instance.

Parameters
obj the object to compare.
Returns
  • true if the effective key length and the initialization vector of both objects are equal, otherwise false.

public int getEffectiveKeyBits ()

Since: API Level 1

Returns the effective key length (in bits).

Returns
  • the effective key length (in bits).

public byte[] getIV ()

Since: API Level 1

Returns a copy of the initialization vector.

Returns
  • a copy of the initialization vector, or null if none specified.

public int hashCode ()

Since: API Level 1

Returns the hash code of this RC2ParameterSpec instance.

Returns
  • the hash code.