Class DES.KeyGenerator
- java.lang.Object
-
- javax.crypto.KeyGeneratorSpi
-
- org.bouncycastle.jcajce.provider.symmetric.util.BaseKeyGenerator
-
- org.bouncycastle.jcajce.provider.symmetric.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.
-
-
Field Summary
-
Fields inherited from class org.bouncycastle.jcajce.provider.symmetric.util.BaseKeyGenerator
algName, defaultKeySize, engine, keySize, uninitialised
-
-
Constructor Summary
Constructors Constructor Description KeyGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SecretKeyengineGenerateKey()Generates a secret key.protected voidengineInit(int keySize, SecureRandom random)Initializes thisKeyGeneratorinstance for the specified key size (in bits) using the specified randomness source.-
Methods inherited from class org.bouncycastle.jcajce.provider.symmetric.util.BaseKeyGenerator
engineInit, engineInit
-
-
-
-
Method Detail
-
engineInit
protected void engineInit(int keySize, SecureRandom random)Description copied from class:KeyGeneratorSpiInitializes thisKeyGeneratorinstance for the specified key size (in bits) using the specified randomness source.- Overrides:
engineInitin classBaseKeyGenerator- 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:KeyGeneratorSpiGenerates a secret key.- Overrides:
engineGenerateKeyin classBaseKeyGenerator- Returns:
- the generated secret key.
-
-