Node:The ModeFactory Class, Next:, Previous:The IMode Interface, Up:Modes



The ModeFactory Class

The preferred way to get mode instances is through the ModeFactory class, from one of the following methods:

static IMode getInstance (java.lang.String mode, java.lang.String cipher, int cipherBlockSize) Function
Returns an instance of cipher wrapped in an instance of mode, initialized to a block size of cipherBlockSize, or returns null if no appropriate cipher or mode is available. The mode argument is one of the names described above, and cipher is one of the names described in the Ciphers chapter.

static IMode getInstance (java.lang.String mode, IBlockCipher cipher, int cipherBlockSize) Function
Returns an instance of mode using the already-initialized cipher, initializing the mode with a block size of cipherBlockSize, or returns null if no appropriate mode is available.

Additionally the following method is defined:

static java.util.Set getNames () Function
This method returns a java.util.Set of the names (each element of type java.lang.String) of all supported modes.