java.lang.Object
javax.crypto.KeyGeneratorSpi
cryptix.jce.provider.key.RawKeyGenerator
- Direct Known Subclasses:
- BlowfishKeyGenerator, CAST5KeyGenerator, DESKeyGenerator, HMACKeyGenerator, IDEAKeyGenerator, MARSKeyGenerator, RC2KeyGenerator, RC4KeyGenerator, RC6KeyGenerator, RijndaelKeyGenerator, SerpentKeyGenerator, SKIPJACKKeyGenerator, SquareKeyGenerator, TripleDESKeyGenerator, TwofishKeyGenerator
- abstract class RawKeyGenerator
- extends javax.crypto.KeyGeneratorSpi
- Version:
- $Revision: 1.8 $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
algorithm
private final java.lang.String algorithm
defaultKeySize
private final int defaultKeySize
random
private java.security.SecureRandom random
keySize
private int keySize
RawKeyGenerator
protected RawKeyGenerator(java.lang.String algorithm,
int defaultKeySize)
engineInit
protected void engineInit(java.security.SecureRandom random)
- Description copied from class:
javax.crypto.KeyGeneratorSpi
- Initialize this key generator with a source of randomness; the
implementation should use reasonable default parameters (such as
generated key size).
engineInit
protected void engineInit(java.security.spec.AlgorithmParameterSpec params,
java.security.SecureRandom random)
throws java.security.InvalidAlgorithmParameterException
- Description copied from class:
javax.crypto.KeyGeneratorSpi
- Initialize this key generator with parameters and a source of
randomness.
engineInit
protected void engineInit(int keysize,
java.security.SecureRandom random)
- Description copied from class:
javax.crypto.KeyGeneratorSpi
- Initialize this key generator with a key size (in bits) and a
source of randomness.
engineGenerateKey
protected javax.crypto.SecretKey engineGenerateKey()
- Description copied from class:
javax.crypto.KeyGeneratorSpi
- Generate a key, returning it as a javax.crypto.SecretKey.
strengthToBits
protected int strengthToBits(int strength)
- Translates strength (complexity, 56 for DES) to bit length
(64 for DES).
fixUp
protected byte[] fixUp(byte[] key)
- Fix up the generated and purely random bytes. For DES this would
fix the parity.
isWeak
protected abstract boolean isWeak(byte[] keyBytes)
- Returns true if the given key is weak.
isValidSize
protected abstract boolean isValidSize(int size)
- Is the given keysize valid for this algorithm?