O'Reilly logo

Java Security by Scott Oaks

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

Class javax.crypto.KeyGenerator

Synopsis

A key generator creates secret keys for use with symmetric ciphers. Key generators are obtained by calling the getInstance() method; they must then be initialized with an init() method. The key itself is then returned from the generateSecret() method.

Class Definition

public class javax.crypto.KeyGenerator
	extends java.lang.Object {

	// Constructors
	protected KeyGenerator(KeyGeneratorSpi, Provider, String);

	// Class Methods
	public static final KeyGenerator getInstance(String);
	public static final KeyGenerator getInstance(String, String);

	// Instance Methods
	public final SecretKey generateKey();
	public final String getAlgorithm();
	public final Provider getProvider();
	public final void init(int);
	public final void init(int, SecureRandom);
	public final void init(SecureRandom);
	public final void init(AlgorithmParameterSpec);
	public final void init(AlgorithmParameterSpec, SecureRandom);
}

See also:

AlgorithmParameterSpec, KeyGeneratorSpi, Provider, SecretKey, SecureRandom

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required