Name

Class java.security.KeyPair

Description

Public and private keys are mathematically related to each other and hence are generated together; this class provides an encapsulation of both the keys as a convenience to key generation.

Class Definition

public final class java.security.KeyPair
  extends java.lang.Object {

  // Constructors
  public KeyPair(PublicKey, PrivateKey);

  // Instance Methods
  public PrivateKey getPrivate();
  public PublicKey getPublic();
}

See Also

KeyPairGenerator, PrivateKey, PublicKey

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.