to top
Android APIs
public class

AlgorithmParameterGenerator

extends Object
java.lang.Object
   ↳ java.security.AlgorithmParameterGenerator

Class Overview

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.
[Expand]
Inherited Methods
From class java.lang.Object

Protected Constructors

protected AlgorithmParameterGenerator (AlgorithmParameterGeneratorSpi paramGenSpi, Provider provider, String algorithm)

Added in API level 1

Constructs a new instance of AlgorithmParameterGenerator with the given arguments.

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

Public Methods

public final AlgorithmParameters generateParameters ()

Added in API level 1

Computes and returns AlgorithmParameters for this generator's algorithm.

Returns
  • AlgorithmParameters for this generator's algorithm.

public final String getAlgorithm ()

Added in API level 1

Returns the name of the algorithm.

Returns
  • the name of the algorithm.

public static AlgorithmParameterGenerator getInstance (String algorithm, String provider)

Added in API level 1

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

Parameters
algorithm the name of the algorithm to use.
provider name of the provider of the AlgorithmParameterGenerator.
Returns
  • 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.

public static AlgorithmParameterGenerator getInstance (String algorithm, Provider provider)

Added in API level 1

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

Parameters
algorithm the name of the algorithm to use.
provider the provider of the AlgorithmParameterGenerator.
Returns
  • 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

public static AlgorithmParameterGenerator getInstance (String algorithm)

Added in API level 1

Returns a new instance of AlgorithmParameterGenerator for the specified algorithm.

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

public final Provider getProvider ()

Added in API level 1

Returns the provider associated with this AlgorithmParameterGenerator.

Returns
  • the provider associated with this AlgorithmParameterGenerator.

public final void init (AlgorithmParameterSpec genParamSpec, SecureRandom random)

Added in API level 1

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

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

public final void init (AlgorithmParameterSpec genParamSpec)

Added in API level 1

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

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

public final void init (int size, SecureRandom random)

Added in API level 1

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

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

public final void init (int size)

Added in API level 1

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

Parameters
size the size (in number of bits).