# AlgorithmParameterGeneratorSpi

public abstract class **AlgorithmParameterGeneratorSpi** extends [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)  
This class defines the *Service Provider Interface* (**SPI** )
for the `AlgorithmParameterGenerator` class, which
is used to generate a set of parameters to be used with a certain algorithm.

All the abstract methods in this class must be implemented by each
cryptographic service provider who wishes to supply the implementation
of a parameter generator for a particular algorithm.

In case the client does not explicitly initialize the
AlgorithmParameterGenerator (via a call to an `engineInit`
method), each provider must supply (and document) a default initialization.
For example, the Sun provider uses a default modulus prime size of 1024
bits for the generation of DSA parameters.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/AlgorithmParameterGenerator.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/AlgorithmParameters.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/AlgorithmParameterSpec.html`

### Public Constructor Summary

|---|---|
|   | [AlgorithmParameterGeneratorSpi](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/AlgorithmParameterGeneratorSpi.html#AlgorithmParameterGeneratorSpi())() |

### Protected Method Summary

|---|---|
| abstract [AlgorithmParameters](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/AlgorithmParameters.html) | [engineGenerateParameters](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/AlgorithmParameterGeneratorSpi.html#engineGenerateParameters())() Generates the parameters. |
| abstract void | [engineInit](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/AlgorithmParameterGeneratorSpi.html#engineInit(java.security.spec.AlgorithmParameterSpec,%20java.security.SecureRandom))([AlgorithmParameterSpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/AlgorithmParameterSpec.html) genParamSpec, [SecureRandom](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/SecureRandom.html) random) Initializes this parameter generator with a set of algorithm-specific parameter generation values. |
| abstract void | [engineInit](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/AlgorithmParameterGeneratorSpi.html#engineInit(int,%20java.security.SecureRandom))(int size, [SecureRandom](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/SecureRandom.html) random) Initializes this parameter generator for a certain size and source of randomness. |

### Inherited Method Summary

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

## Public Constructors

#### public
**AlgorithmParameterGeneratorSpi**
()

<br />

## Protected Methods

#### protected abstract [AlgorithmParameters](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/AlgorithmParameters.html)
**engineGenerateParameters**
()

Generates the parameters.

##### Returns

- the new AlgorithmParameters object.

#### protected abstract void
**engineInit**
([AlgorithmParameterSpec](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/AlgorithmParameterSpec.html) genParamSpec, [SecureRandom](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/SecureRandom.html) random)

Initializes this parameter generator with a set of
algorithm-specific parameter generation values.

##### Parameters

| genParamSpec | the set of algorithm-specific parameter generation values. |
| random | the source of randomness. |
|---|---|

##### Throws

| [InvalidAlgorithmParameterException](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/InvalidAlgorithmParameterException.html) | if the given parameter generation values are inappropriate for this parameter generator. |
|---|---|

#### protected abstract void
**engineInit**
(int size, [SecureRandom](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/SecureRandom.html) random)

Initializes this parameter generator for a certain size
and source of randomness.

##### Parameters

| size | the size (number of bits). |
| random | the source of randomness. |
|---|---|