gnu.crypto.mode

Class ModeFactory

public class ModeFactory extends Object implements Registry

A Factory to instantiate block cipher modes of operations.

Version: $Revision: 1.10 $

Method Summary
static IModegetInstance(String mode, String cipher, int cipherBlockSize)

Returns an instance of a block cipher mode of operations given its name and characteristics of the underlying block cipher.

static IModegetInstance(String mode, IBlockCipher cipher, int cipherBlockSize)
static SetgetNames()

Returns a java.util.Set of names of mode supported by this Factory.

Method Detail

getInstance

public static IMode getInstance(String mode, String cipher, int cipherBlockSize)

Returns an instance of a block cipher mode of operations given its name and characteristics of the underlying block cipher.

Parameters: mode the case-insensitive name of the mode of operations. cipher the case-insensitive name of the block cipher. cipherBlockSize the block size, in bytes, of the underlying cipher.

Returns: an instance of the block cipher algorithm, operating in a given mode of operations, or null if none found.

Throws: InternalError if either the mode or the underlying block cipher implementation does not pass its self-test.

getInstance

public static IMode getInstance(String mode, IBlockCipher cipher, int cipherBlockSize)

getNames

public static final Set getNames()

Returns a java.util.Set of names of mode supported by this Factory.

Returns: a java.util.Set of mode names (Strings).

Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.