BaseKeyGenerator (Bouncy Castle Library 1.54 API Specification)
Date: 2015-12-29

org.bouncycastle.jcajce.provider.symmetric.util

## Class BaseKeyGenerator

- java.lang.Object
- - javax.crypto.KeyGeneratorSpi
  - - org.bouncycastle.jcajce.provider.symmetric.util.BaseKeyGenerator

- Direct Known Subclasses:
    AES.KeyGen, AES.Poly1305KeyGen, ARC4.KeyGen, Blowfish.KeyGen, Camellia.KeyGen, Camellia.Poly1305KeyGen, CAST5.KeyGen, CAST6.KeyGen, CAST6.Poly1305KeyGen, ChaCha.KeyGen, DES.KeyGenerator, DESede.KeyGenerator, DESede.KeyGenerator3, GOST28147.KeyGen, GOST3411.KeyGenerator, Grain128.KeyGen, Grainv1.KeyGen, HC128.KeyGen, HC256.KeyGen, IDEA.KeyGen, Keccak.KeyGenerator224, Keccak.KeyGenerator256, Keccak.KeyGenerator288, Keccak.KeyGenerator384, Keccak.KeyGenerator512, MD2.KeyGenerator, MD4.KeyGenerator, MD5.KeyGenerator, Noekeon.KeyGen, Noekeon.Poly1305KeyGen, RC2.KeyGenerator, RC5.KeyGen32, RC5.KeyGen64, RC6.KeyGen, RC6.Poly1305KeyGen, Rijndael.KeyGen, RIPEMD128.KeyGenerator, RIPEMD160.KeyGenerator, RIPEMD256.KeyGenerator, RIPEMD320.KeyGenerator, Salsa20.KeyGen, SEED.KeyGen, SEED.Poly1305KeyGen, Serpent.KeyGen, Serpent.Poly1305KeyGen, Serpent.TKeyGen, SHA1.KeyGenerator, SHA224.KeyGenerator, SHA256.KeyGenerator, SHA384.KeyGenerator, SHA512.KeyGenerator, SHA512.KeyGeneratorT224, SHA512.KeyGeneratorT256, Shacal2.KeyGen, SipHash.KeyGen, Skein.HMacKeyGenerator_1024_1024, Skein.HMacKeyGenerator_1024_384, Skein.HMacKeyGenerator_1024_512, Skein.HMacKeyGenerator_256_128, Skein.HMacKeyGenerator_256_160, Skein.HMacKeyGenerator_256_224, Skein.HMacKeyGenerator_256_256, Skein.HMacKeyGenerator_512_128, Skein.HMacKeyGenerator_512_160, Skein.HMacKeyGenerator_512_224, Skein.HMacKeyGenerator_512_256, Skein.HMacKeyGenerator_512_384, Skein.HMacKeyGenerator_512_512, Skein.SkeinMacKeyGenerator_1024_1024, Skein.SkeinMacKeyGenerator_1024_384, Skein.SkeinMacKeyGenerator_1024_512, Skein.SkeinMacKeyGenerator_256_128, Skein.SkeinMacKeyGenerator_256_160, Skein.SkeinMacKeyGenerator_256_224, Skein.SkeinMacKeyGenerator_256_256, Skein.SkeinMacKeyGenerator_512_128, Skein.SkeinMacKeyGenerator_512_160, Skein.SkeinMacKeyGenerator_512_224, Skein.SkeinMacKeyGenerator_512_256, Skein.SkeinMacKeyGenerator_512_384, Skein.SkeinMacKeyGenerator_512_512, Skipjack.KeyGen, SM4.KeyGen, SM4.Poly1305KeyGen, TEA.KeyGen, Threefish.KeyGen_1024, Threefish.KeyGen_256, Threefish.KeyGen_512, Tiger.KeyGenerator, Twofish.KeyGen, Twofish.Poly1305KeyGen, VMPC.KeyGen, VMPCKSA3.KeyGen, Whirlpool.KeyGenerator, XSalsa20.KeyGen, XTEA.KeyGen

      public class BaseKeyGenerator
      extends javax.crypto.KeyGeneratorSpi

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.String` | `algName`
    `protected int` | `defaultKeySize`
    `protected CipherKeyGenerator` | `engine`
    `protected int` | `keySize`
    `protected boolean` | `uninitialised`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `BaseKeyGenerator(java.lang.String algName, int defaultKeySize, CipherKeyGenerator engine)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected javax.crypto.SecretKey` | `engineGenerateKey()`
    `protected void` | `engineInit(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random)`
    `protected void` | `engineInit(int keySize, java.security.SecureRandom random)`
    `protected void` | `engineInit(java.security.SecureRandom random)`

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

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

- - ### Field Detail

    - #### algName

          protected java.lang.String algName

    - #### keySize

          protected int keySize

    - #### defaultKeySize

          protected int defaultKeySize

    - #### engine

          protected CipherKeyGenerator engine

    - #### uninitialised

          protected boolean uninitialised

  - ### Constructor Detail

    - #### BaseKeyGenerator

          protected BaseKeyGenerator(java.lang.String algName,
                          int defaultKeySize,
                          CipherKeyGenerator engine)

  - ### Method Detail

    - #### engineInit

          protected void engineInit(java.security.spec.AlgorithmParameterSpec params,
                        java.security.SecureRandom random)
                             throws java.security.InvalidAlgorithmParameterException

      Specified by:
        `engineInit` in class `javax.crypto.KeyGeneratorSpi`
      Throws:
        `java.security.InvalidAlgorithmParameterException`

    - #### engineInit

          protected void engineInit(java.security.SecureRandom random)

      Specified by:
        `engineInit` in class `javax.crypto.KeyGeneratorSpi`

    - #### engineInit

          protected void engineInit(int keySize,
                        java.security.SecureRandom random)

      Specified by:
        `engineInit` in class `javax.crypto.KeyGeneratorSpi`

    - #### engineGenerateKey

          protected javax.crypto.SecretKey engineGenerateKey()

      Specified by:
        `engineGenerateKey` in class `javax.crypto.KeyGeneratorSpi`