Skip to content

Most visited

Recently visited

navigation
Added in API level 1

AlgorithmParameterGenerator

public class AlgorithmParameterGenerator
extends Object

java.lang.Object
   ↳ java.security.AlgorithmParameterGenerator


AlgorithmParameterGenerator is an engine class which is capable of generating parameters for the algorithm it was initialized with.

Summary

Protected constructors

AlgorithmParameterGenerator(AlgorithmParameterGeneratorSpi paramGenSpi, Provider provider, String algorithm)

Constructs a new instance of AlgorithmParameterGenerator with the given arguments.

Public methods

final AlgorithmParameters generateParameters()

Computes and returns AlgorithmParameters for this generator's algorithm.

final String getAlgorithm()

Returns the name of the algorithm.

static AlgorithmParameterGenerator getInstance(String algorithm, String provider)

Returns a new instance of AlgorithmParameterGenerator from the specified provider 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)

Returns a new instance of AlgorithmParameterGenerator for the specified algorithm.

final Provider getProvider()

Returns the provider associated with this AlgorithmParameterGenerator.

final void init(AlgorithmParameterSpec genParamSpec, SecureRandom random)

Initializes this AlgorithmParameterGenerator with the given AlgorithmParameterSpec and the given SecureRandom.

final void init(AlgorithmParameterSpec genParamSpec)

Initializes this AlgorithmParameterGenerator with the given AlgorithmParameterSpec.

final void init(int size, SecureRandom random)

Initializes this AlgorithmParameterGenerator with the given size and the given SecureRandom.

final void init(int size)

Initializes this AlgorithmParameterGenerator with the given size.

Inherited methods

From class java.lang.Object

Protected constructors

AlgorithmParameterGenerator

Added in API level 1
AlgorithmParameterGenerator (AlgorithmParameterGeneratorSpi paramGenSpi, 
                Provider provider, 
                String algorithm)

Constructs a new instance of AlgorithmParameterGenerator with the given arguments.

Parameters
paramGenSpi AlgorithmParameterGeneratorSpi: a concrete implementation, this engine instance delegates to.
provider Provider: the provider.
algorithm String: the name of the algorithm.

Public methods

generateParameters

Added in API level 1
AlgorithmParameters generateParameters ()

Computes and returns AlgorithmParameters for this generator's algorithm.

Returns
AlgorithmParameters AlgorithmParameters for this generator's algorithm.

getAlgorithm

Added in API level 1
String getAlgorithm ()

Returns the name of the algorithm.

Returns
String the name of the algorithm.

getInstance

Added in API level 1
AlgorithmParameterGenerator getInstance (String algorithm, 
                String provider)

Returns a new instance of AlgorithmParameterGenerator from the specified provider for the specified algorithm.

Parameters
algorithm String: the name of the algorithm to use.
provider String: name of the provider of the AlgorithmParameterGenerator.
Returns
AlgorithmParameterGenerator a new instance of AlgorithmParameterGenerator for the specified algorithm.
Throws
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.

getInstance

Added in API level 1
AlgorithmParameterGenerator getInstance (String algorithm, 
                Provider provider)

Returns a new instance of AlgorithmParameterGenerator from the specified provider for the specified algorithm. The provider supplied does not have to be registered.

Parameters
algorithm String: the name of the algorithm to use.
provider Provider: the provider of the AlgorithmParameterGenerator.
Returns
AlgorithmParameterGenerator a new instance of AlgorithmParameterGenerator for the specified algorithm.
Throws
NoSuchAlgorithmException if the specified algorithm is not available.
NullPointerException if algorithm is null.
IllegalArgumentException if provider == null

getInstance

Added in API level 1
AlgorithmParameterGenerator getInstance (String algorithm)

Returns a new instance of AlgorithmParameterGenerator for the specified algorithm.

Parameters
algorithm String: the name of the algorithm to use.
Returns
AlgorithmParameterGenerator a new instance of AlgorithmParameterGenerator for the specified algorithm.
Throws
NoSuchAlgorithmException if the specified algorithm is not available.
NullPointerException if algorithm is null.

getProvider

Added in API level 1
Provider getProvider ()

Returns the provider associated with this AlgorithmParameterGenerator.

Returns
Provider the provider associated with this AlgorithmParameterGenerator.

init

Added in API level 1
void init (AlgorithmParameterSpec genParamSpec, 
                SecureRandom random)

Initializes this AlgorithmParameterGenerator with the given AlgorithmParameterSpec and the given SecureRandom.

Parameters
genParamSpec AlgorithmParameterSpec: the parameters to use.
random SecureRandom: the source of randomness.
Throws
InvalidAlgorithmParameterException if the specified parameters are not supported.

init

Added in API level 1
void init (AlgorithmParameterSpec genParamSpec)

Initializes this AlgorithmParameterGenerator with the given AlgorithmParameterSpec. A default SecureRandom instance will be used.

Parameters
genParamSpec AlgorithmParameterSpec: the parameters to use.
Throws
InvalidAlgorithmParameterException if the specified parameters are not supported.

init

Added in API level 1
void init (int size, 
                SecureRandom random)

Initializes this AlgorithmParameterGenerator with the given size and the given SecureRandom. The default parameter set will be used.

Parameters
size int: the size (in number of bits).
random SecureRandom: the source of randomness.

init

Added in API level 1
void init (int size)

Initializes this AlgorithmParameterGenerator with the given size. The default parameter set and a default SecureRandom instance will be used.

Parameters
size int: the size (in number of bits).
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.