iaik.security.cipher
Class CAST128ParameterSpec

java.lang.Object
  |
  +--iaik.security.cipher.CAST128ParameterSpec
All Implemented Interfaces:
AlgorithmParameterSpec

public class CAST128ParameterSpec
extends Object
implements AlgorithmParameterSpec

CAST parameter specification.

This class represents parameters for the CAST128 algorithm as specified by RFC 2144:

 Parameters ::= SEQUENCE {
      iv         OCTET STRING DEFAULT 0,  -- Initialization vector
      keyLength  INTEGER                  -- Key length, in bits
 }
 
If no initialization vector is included it defaults to an IV of all zeros.

Version:
File Revision 8

Constructor Summary
CAST128ParameterSpec(int keyLength)
          Creates a CAST128ParametersSpec from the given keyLength value.
CAST128ParameterSpec(int keyLength, byte[] initVector)
          Creates a CAST128ParametersSpec by using the first 8 bytes of the supplied byte array as initialization vector (IV).
CAST128ParameterSpec(int keyLength, byte[] initVector, int offset)
          Creates a CAST128ParametersSpec by using 8 bytes of the supplied byte array as IV, beginning at the given offset.
 
Method Summary
 byte[] getIV()
          Returns a copy of the initialization vector (IV) as byte array representation.
 int getKeyLength()
          Return the key length.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CAST128ParameterSpec

public CAST128ParameterSpec(int keyLength)
Creates a CAST128ParametersSpec from the given keyLength value.
Parameters:
keyLength - the key length

CAST128ParameterSpec

public CAST128ParameterSpec(int keyLength,
                            byte[] initVector)
Creates a CAST128ParametersSpec by using the first 8 bytes of the supplied byte array as initialization vector (IV).
Parameters:
keyLength - the key length
initVector - the byte array holding the IV

CAST128ParameterSpec

public CAST128ParameterSpec(int keyLength,
                            byte[] initVector,
                            int offset)
Creates a CAST128ParametersSpec by using 8 bytes of the supplied byte array as IV, beginning at the given offset.
Parameters:
keyLength - the key length
initVector - the byte array holding the IV
offset - the offset indicating the start position within the input IV byte array
Method Detail

getKeyLength

public int getKeyLength()
Return the key length.
Returns:
the key length

getIV

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

If no initialization vector has been set, a default iv off all zeros is returned as required by RFC 2144.

Returns:
a copy of the initialization vector (IV) as byte array representation

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