Node:The CipherFactory Class, Next:, Previous:The IBlockCipher Interface, Up:Ciphers



The CipherFactory Class

The ciphers in GNU Crypto can usually be initiallized directly through their constructors, but the preferred way is to use the CipherFactory class, with the following method:

static IBlockCipher getInstance (java.lang.String name) Function
Returns a new cipher instance for the cipher named name, or null if no such cipher exists. This method will throw a java.lang.InternalError if the new instance's self-test fails.

The class also defines this method:

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 ciphers.