Methods Summary |
---|
public final javax.crypto.SecretKey | generateKey()Generates a secret key.
return spiImpl.engineGenerateKey();
|
public final java.lang.String | getAlgorithm()Returns the name of the key generation algorithm.
return algorithm;
|
public static final javax.crypto.KeyGenerator | getInstance(java.lang.String algorithm)Creates a new {@code KeyGenerator} instance that provides the specified
key algorithm,
if (algorithm == null) {
throw new NullPointerException(Messages.getString("crypto.02")); //$NON-NLS-1$
}
synchronized (engine) {
engine.getInstance(algorithm, null);
return new KeyGenerator((KeyGeneratorSpi) engine.spi, engine.provider,
algorithm);
}
|
public static final javax.crypto.KeyGenerator | getInstance(java.lang.String algorithm, java.lang.String provider)Creates a new {@code KeyGenerator} instance that provides the specified
key algorithm from the specified provider.
if ((provider == null) || (provider.length() == 0)) {
throw new IllegalArgumentException(Messages.getString("crypto.03")); //$NON-NLS-1$
}
Provider impProvider = Security.getProvider(provider);
if (impProvider == null) {
throw new NoSuchProviderException(provider);
}
return getInstance(algorithm, impProvider);
|
public static final javax.crypto.KeyGenerator | getInstance(java.lang.String algorithm, java.security.Provider provider)Creates a new {@code KeyGenerator} instance that provides the specified
key algorithm from the specified provider.
if (provider == null) {
throw new IllegalArgumentException(Messages.getString("crypto.04")); //$NON-NLS-1$
}
if (algorithm == null) {
throw new NullPointerException(Messages.getString("crypto.02")); //$NON-NLS-1$
}
synchronized (engine) {
engine.getInstance(algorithm, provider, null);
return new KeyGenerator((KeyGeneratorSpi) engine.spi, provider,
algorithm);
}
|
public final java.security.Provider | getProvider()Returns the provider of this {@code KeyGenerator} instance.
return provider;
|
public final void | init(int keysize)Initializes this {@code KeyGenerator} instance for the specified key size
(in bits).
spiImpl.engineInit(keysize, rndm);//new SecureRandom());
|
public final void | init(int keysize, java.security.SecureRandom random)Initializes this {@code KeyGenerator} instance for the specified key size
(in bits) using the specified randomness source.
spiImpl.engineInit(keysize, random);
|
public final void | init(java.security.SecureRandom random)Initializes this {@code KeyGenerator} with the specified randomness
source.
spiImpl.engineInit(random);
|
public final void | init(java.security.spec.AlgorithmParameterSpec params)Initializes this {@code KeyGenerator} instance with the specified
algorithm parameters.
spiImpl.engineInit(params, rndm);//new SecureRandom());
|
public final void | init(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random)Initializes this {@code KeyGenerator} instance with the specified
algorithm parameters and randomness source.
spiImpl.engineInit(params, random);
|