Name

Class java.security.KeyPair

Synopsis

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 Security, 2nd Edition 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.