Name
AlgorithmParameterGenerator
Synopsis
This
class defines a generic API for generating
parameters for a cryptographic algorithm, typically a
Signature or a
javax.crypto.Cipher. Create an
AlgorithmParameterGenerator by calling one of the
static
getInstance(
) factory methods and specifying the name of the algorithm
and, optionally, the name or Provider object of
the desired provider. The default
“SUN” provider supports the
“DSA” algorithm. The
“SunJCE” provider shipped with the
JCE supports “DiffieHellman”. Once
you have obtained a generator, initialize it by calling the
init( ) method and specifying an
algorithm-independent parameter size (in bits) or an
algorithm-dependent AlgorithmParameterSpec object.
You may also specify a SecureRandom source of
randomness when you call init( ). Once you have
created and initialized the
AlgorithmParameterGenerator, call
generateParameters( ) to generate an
AlgorithmParameters object.
public class AlgorithmParameterGenerator { // Protected Constructors protected AlgorithmParameterGenerator(AlgorithmParameterGeneratorSpi paramGenSpi, Provider provider, String algorithm); // Public Class Methods public static AlgorithmParameterGenerator getInstance(String algorithm) throws NoSuchAlgorithmException; 1.4 public static AlgorithmParameterGenerator getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException; public static AlgorithmParameterGenerator getInstance(String algorithm, String provider) throws NoSuchAlgorithmException, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access