public class AlgorithmParameterGenerator extends Object
AlgorithmParameterGenerator is an engine class which is capable of
generating parameters for the algorithm it was initialized with.| Modifier | Constructor and Description |
|---|---|
protected |
AlgorithmParameterGenerator(AlgorithmParameterGeneratorSpi paramGenSpi,
Provider provider,
String algorithm)
Constructs a new instance of
AlgorithmParameterGenerator with the
given arguments. |
| Modifier and Type | Method and Description |
|---|---|
AlgorithmParameters |
generateParameters()
Computes and returns
AlgorithmParameters for this generator's
algorithm. |
String |
getAlgorithm()
Returns the name of the algorithm.
|
static AlgorithmParameterGenerator |
getInstance(String algorithm)
Returns a new instance of
AlgorithmParameterGenerator for the
specified algorithm. |
static AlgorithmParameterGenerator |
getInstance(String algorithm,
Provider provider)
Returns a new instance of
AlgorithmParameterGenerator from the
specified provider for the specified algorithm. |
static AlgorithmParameterGenerator |
getInstance(String algorithm,
String provider)
Returns a new instance of
AlgorithmParameterGenerator from the
specified provider for the specified algorithm. |
Provider |
getProvider()
Returns the provider associated with this
AlgorithmParameterGenerator. |
void |
init(AlgorithmParameterSpec genParamSpec)
Initializes this
AlgorithmParameterGenerator with the given AlgorithmParameterSpec. |
void |
init(AlgorithmParameterSpec genParamSpec,
SecureRandom random)
Initializes this
AlgorithmParameterGenerator with the given
AlgorithmParameterSpec and the given SecureRandom. |
void |
init(int size)
Initializes this
AlgorithmParameterGenerator with the given size. |
void |
init(int size,
SecureRandom random)
Initializes this
AlgorithmParameterGenerator with the given size
and the given SecureRandom. |
protected AlgorithmParameterGenerator(AlgorithmParameterGeneratorSpi paramGenSpi, Provider provider, String algorithm)
AlgorithmParameterGenerator with the
given arguments.paramGenSpi - a concrete implementation, this engine instance delegates to.provider - the provider.algorithm - the name of the algorithm.public final String getAlgorithm()
public static AlgorithmParameterGenerator getInstance(String algorithm) throws NoSuchAlgorithmException
AlgorithmParameterGenerator for the
specified algorithm.algorithm - the name of the algorithm to use.AlgorithmParameterGenerator for the
specified algorithm.NoSuchAlgorithmException - if the specified algorithm is not available.NullPointerException - if algorithm is null.public static AlgorithmParameterGenerator getInstance(String algorithm, String provider) throws NoSuchAlgorithmException, NoSuchProviderException
AlgorithmParameterGenerator from the
specified provider for the specified algorithm.algorithm - the name of the algorithm to use.provider - name of the provider of the AlgorithmParameterGenerator.AlgorithmParameterGenerator for the
specified algorithm.NoSuchAlgorithmException - if the specified algorithm is not available.NoSuchProviderException - if the specified provider is not available.IllegalArgumentException - if provider == null || provider.isEmpty()NullPointerException - if algorithm is null.public static AlgorithmParameterGenerator getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException
AlgorithmParameterGenerator from the
specified provider for the specified algorithm. The provider
supplied does not have to be registered.algorithm - the name of the algorithm to use.provider - the provider of the AlgorithmParameterGenerator.AlgorithmParameterGenerator for the
specified algorithm.NoSuchAlgorithmException - if the specified algorithm is not available.NullPointerException - if algorithm is null.IllegalArgumentException - if provider == nullpublic final Provider getProvider()
AlgorithmParameterGenerator.AlgorithmParameterGenerator.public final void init(int size)
AlgorithmParameterGenerator with the given size.
The default parameter set and a default SecureRandom instance
will be used.size - the size (in number of bits).public final void init(int size,
SecureRandom random)
AlgorithmParameterGenerator with the given size
and the given SecureRandom. The default parameter set will be
used.size - the size (in number of bits).random - the source of randomness.public final void init(AlgorithmParameterSpec genParamSpec) throws InvalidAlgorithmParameterException
AlgorithmParameterGenerator with the given AlgorithmParameterSpec. A default SecureRandom instance will be
used.genParamSpec - the parameters to use.InvalidAlgorithmParameterException - if the specified parameters are not supported.public final void init(AlgorithmParameterSpec genParamSpec, SecureRandom random) throws InvalidAlgorithmParameterException
AlgorithmParameterGenerator with the given
AlgorithmParameterSpec and the given SecureRandom.genParamSpec - the parameters to use.random - the source of randomness.InvalidAlgorithmParameterException - if the specified parameters are not supported.public final AlgorithmParameters generateParameters()
AlgorithmParameters for this generator's
algorithm.AlgorithmParameters for this generator's algorithm.