Key generators are constructed using one of the getInstance class methods of this class. KeyGenerator objects are reusable, i.e., after a key has been generated, the same KeyGenerator object can be re-used to generate further keys.
All key generators share the concepts of a keysize and a source of randomness .
There is an init method in this KeyGenerator class that takes these two universally shared types of arguments. For situations where a set of algorithm-specific parameters already exists, there are two init methods that have an AlgorithmParameterSpec argument. Generates a KeyGenerator object for the specified algorithm. Initializes this key generator with the specified parameter set and a user-provided source of randomness. Initializes this key generator for a certain keysize, using a user-provided source of randomness.