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 KeyPairGenerator

Synopsis

This is an engine class that is capable of generating a public key and its related private key. Instances of this class will generate key pairs that are appropriate for a particular algorithm (DSA, RSA, etc.). A key pair generator may be initialized to return keys of a particular strength (which is usually the number of bits in the key), or it may be initialized in an algorithmic-specific way; the former case is the one implemented by most key generators. An instance of this class may be used to generate any number of key pairs.

Class Definition

public abstract class java.security.KeyPairGenerator
	extends java.security.KeyPairGeneratorSpi {

	// Constructors
	protected KeyPairGenerator(String);

	// Class Methods
	public static KeyPairGenerator getInstance(String);
	public static KeyPairGenerator getInstance(String, String);

	// Instance Methods
	public final KeyPair genKeyPair();
	public String getAlgorithm();
	public final Provider getProvider();
	public void initialize(int);
	public void initialize(int, SecureRandom)
	public void initialize(AlgorithmParameterSpec, SecureRandom);
	public void initialize(AlgorithmParameterSpec);
}

See also:

AlgorithmParameterSpec, KeyPair

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