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

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.