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

Get Java Security now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.