Class DES.KeyGenerator

Enclosing class:
DES

public static class DES.KeyGenerator
extends BaseKeyGenerator
DES - the default for this is to generate a key in a-b-a format that's 24 bytes long but has 16 bytes of key material (the first 8 bytes is repeated as the last 8 bytes). If you give it a size, you'll get just what you asked for.
  • Constructor Details

    • KeyGenerator

      public KeyGenerator()
  • Method Details

    • engineInit

      protected void engineInit​(int keySize, SecureRandom random)
      Description copied from class: KeyGeneratorSpi
      Initializes this KeyGenerator instance for the specified key size (in bits) using the specified randomness source.
      Overrides:
      engineInit in class BaseKeyGenerator
      Parameters:
      keySize - the size of the key (in bits).
      random - the randomness source for any random bytes.
    • engineGenerateKey

      protected SecretKey engineGenerateKey()
      Description copied from class: KeyGeneratorSpi
      Generates a secret key.
      Overrides:
      engineGenerateKey in class BaseKeyGenerator
      Returns:
      the generated secret key.