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

org.bouncycastle.crypto

## Class KeyGenerationParameters

- java.lang.Object
- - org.bouncycastle.crypto.KeyGenerationParameters

- Direct Known Subclasses:
    AIMerKeyGenerationParameters, BLSKeyGenerationParameters, CMCEKeyGenerationParameters, CMCEKeyGenerationParameters, CramerShoupKeyGenerationParameters, DHKeyGenerationParameters, DilithiumKeyGenerationParameters, DSAKeyGenerationParameters, ECCSIKeyGenerationParameters, ECKeyGenerationParameters, Ed25519KeyGenerationParameters, Ed448KeyGenerationParameters, ElGamalKeyGenerationParameters, FaestKeyGenerationParameters, FalconKeyGenerationParameters, FrodoKEMKeyGenerationParameters, FrodoKeyGenerationParameters, GOST3410KeyGenerationParameters, HAETAEKeyGenerationParameters, HawkKeyGenerationParameters, HQCKeyGenerationParameters, HSSKeyGenerationParameters, LMSKeyGenerationParameters, MayoKeyGenerationParameters, MLDSAKeyGenerationParameters, MLDSAKeyGenerationParameters, MLKEMKeyGenerationParameters, MLKEMKeyGenerationParameters, MQOMKeyGenerationParameters, NaccacheSternKeyGenerationParameters, NTRUKeyGenerationParameters, NTRULPRimeKeyGenerationParameters, NTRUPlusKeyGenerationParameters, QRUOVKeyGenerationParameters, RSAKeyGenerationParameters, SABERKeyGenerationParameters, SDitHKeyGenerationParameters, SLHDSAKeyGenerationParameters, SLHDSAKeyGenerationParameters, SnovaKeyGenerationParameters, SNTRUPrimeKeyGenerationParameters, SPHINCS256KeyGenerationParameters, SQIsignKeyGenerationParameters, UOVKeyGenerationParameters, X25519KeyGenerationParameters, X448KeyGenerationParameters, XMSSKeyGenerationParameters, XMSSMTKeyGenerationParameters, XWingKeyGenerationParameters

      public class KeyGenerationParameters
      extends java.lang.Object

  The base class for parameters to key generators.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `KeyGenerationParameters(java.security.SecureRandom random, int strength)` initialise the generator with a source of randomness and a strength (in bits).

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.security.SecureRandom` | `getRandom()` return the random source associated with this generator.
    `int` | `getStrength()` return the bit strength for keys produced by this generator,

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

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

- - ### Constructor Detail

    - #### KeyGenerationParameters

          public KeyGenerationParameters(java.security.SecureRandom random,
                                         int strength)

      initialise the generator with a source of randomness and a strength (in bits).
      Parameters:
        `random` - the random byte source.
        `strength` - the size, in bits, of the keys we want to produce.

  - ### Method Detail

    - #### getRandom

          public java.security.SecureRandom getRandom()

      return the random source associated with this generator.
      Returns:
        the generators random source.

    - #### getStrength

          public int getStrength()

      return the bit strength for keys produced by this generator,
      Returns:
        the strength of the keys this generator produces (in bits).