Package javax.crypto

Class 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 Detail

      • KeyGeneratorSpi

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

      • engineGenerateKey

        protected abstract SecretKey engineGenerateKey()
        Generates a secret key.
        Returns:
        the generated secret key.
      • 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.