Name

Class java.security.KeyPairGenerator

Description

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 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(AlgorithmParameterSpec);
}

See Also

AlgorithmParameterSpec, KeyPair

Get Java Cryptography 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.