RC2ParameterSpec
open class RC2ParameterSpec : AlgorithmParameterSpec
kotlin.Any | |
↳ | javax.crypto.spec.RC2ParameterSpec |
This class specifies the parameters used with the RC2 algorithm.
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.
Summary
Public constructors | |
---|---|
RC2ParameterSpec(effectiveKeyBits: Int) Constructs a parameter set for RC2 from the given effective key size (in bits). |
|
RC2ParameterSpec(effectiveKeyBits: Int, iv: ByteArray!) Constructs a parameter set for RC2 from the given effective key size (in bits) and an 8-byte IV. |
|
RC2ParameterSpec(effectiveKeyBits: Int, iv: ByteArray!, offset: Int) Constructs a parameter set for RC2 from the given effective key size (in bits) and IV. |
Public methods | |
---|---|
open Boolean |
Tests for equality between the specified object and this object. |
open Int |
Returns the effective key size in bits. |
open ByteArray! |
getIV() Returns the IV or null if this parameter set does not contain an IV. |
open Int |
hashCode() Calculates a hash code value for the object. |
Public constructors
RC2ParameterSpec
RC2ParameterSpec(effectiveKeyBits: Int)
Constructs a parameter set for RC2 from the given effective key size (in bits).
Parameters | |
---|---|
effectiveKeyBits |
Int: the effective key size in bits. |
RC2ParameterSpec
RC2ParameterSpec(
effectiveKeyBits: Int,
iv: ByteArray!)
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 iv[0]
and iv[7]
inclusive.
Parameters | |
---|---|
effectiveKeyBits |
Int: the effective key size in bits. |
iv |
ByteArray!: the buffer with the 8-byte IV. The first 8 bytes of the buffer are copied to protect against subsequent modification. |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if iv is null. |
RC2ParameterSpec
RC2ParameterSpec(
effectiveKeyBits: Int,
iv: ByteArray!,
offset: Int)
Constructs a parameter set for RC2 from the given effective key size (in bits) and IV.
The IV is taken from iv
, starting at offset
inclusive. The bytes that constitute the IV are those between iv[offset]
and iv[offset+7]
inclusive.
Parameters | |
---|---|
effectiveKeyBits |
Int: the effective key size in bits. |
iv |
ByteArray!: the buffer with the IV. The first 8 bytes of the buffer beginning at offset inclusive are copied to protect against subsequent modification. |
offset |
Int: the offset in iv where the 8-byte IV starts. |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if iv is null. |
Public methods
equals
open fun equals(other: Any?): Boolean
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 null.)
Parameters | |
---|---|
obj |
the object to test for equality with this object. |
Return | |
---|---|
Boolean |
true if the objects are considered equal, false if obj is null or otherwise. |
getEffectiveKeyBits
open fun getEffectiveKeyBits(): Int
Returns the effective key size in bits.
Return | |
---|---|
Int |
the effective key size in bits. |
getIV
open fun getIV(): ByteArray!
Returns the IV or null if this parameter set does not contain an IV.
Return | |
---|---|
ByteArray! |
the IV or null if this parameter set does not contain an IV. Returns a new array each time this method is called. |
hashCode
open fun hashCode(): Int
Calculates a hash code value for the object. Objects that are equal will also have the same hashcode.
Return | |
---|---|
Int |
a hash code value for this object. |