CramerShoupParametersGenerator (Bouncy Castle Library 1.85 API Specification)
Date: 2026-07-12

org.bouncycastle.crypto.generators

## Class CramerShoupParametersGenerator

- java.lang.Object
- - org.bouncycastle.crypto.generators.CramerShoupParametersGenerator

-     public class CramerShoupParametersGenerator
      extends java.lang.Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CramerShoupParametersGenerator()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `CramerShoupParameters` | `generateParameters()` which generates the p and g values from the given parameters, returning the CramerShoupParameters object.
    `CramerShoupParameters` | `generateParameters(DHParameters dhParams)`
    `void` | `init(int size, int certainty, java.security.SecureRandom random)` Initialise the parameters generator.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CramerShoupParametersGenerator

          public CramerShoupParametersGenerator()

  - ### Method Detail

    - #### init

          public void init(int size,
                           int certainty,
                           java.security.SecureRandom random)

      Initialise the parameters generator.
      Parameters:
        `size` - bit length for the prime p
        `certainty` - a measure of the uncertainty that the caller is willing to tolerate: the probability that the generated modulus is prime exceeds (1 - 1/2^certainty). The execution time of this method is proportional to the value of this parameter.
        `random` - a source of randomness

    - #### generateParameters

          public CramerShoupParameters generateParameters()

      which generates the p and g values from the given parameters, returning the CramerShoupParameters object.

      Note: can take a while...

      Returns:
        a generated CramerShoupParameters object.

    - #### generateParameters

          public CramerShoupParameters generateParameters(DHParameters dhParams)