Package javax.crypto

Class KeyGeneratorSpi

java.lang.Object
javax.crypto.KeyGeneratorSpi
Direct Known Subclasses:
BaseKeyGenerator

public abstract class KeyGeneratorSpi
extends Object
The Service Provider Interface (SPI) definition for the KeyGenerator class.
See Also:
KeyGenerator
  • Constructor Details

    • KeyGeneratorSpi

      public KeyGeneratorSpi()
      Creates a new KeyGeneratorSpi instance.
  • Method Details

    • engineGenerateKey

      protected abstract SecretKey engineGenerateKey()
      Generates a secret key.
      Returns:
      the generated secret key.
    • engineInit

      protected abstract void engineInit​(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException
      Initializes this KeyGeneratorSpi instance with the specified algorithm parameters and randomness source.
      Parameters:
      params - the parameters for the key generation algorithm.
      random - the randomness source for any random bytes.
      Throws:
      InvalidAlgorithmParameterException - if the parameters cannot be uses to initialize this key generator algorithm.
    • engineInit

      protected abstract void engineInit​(int keysize, SecureRandom random)
      Initializes this KeyGenerator instance for the specified key size (in bits) using the specified randomness source.
      Parameters:
      keysize - the size of the key (in bits).
      random - the randomness source for any random bytes.
    • engineInit

      protected abstract void engineInit​(SecureRandom random)
      Initializes this KeyGenerator with the specified randomness source.
      Parameters:
      random - the randomness source for any random bytes.