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 javax.crypto.KeyAgreement

Synopsis

This engine class represents a key agreement protocol, which is an arrangement by which two parties can agree on a secret value. You can obtain an instance of this class by calling the getInstance() method. After initializing the object (see init()), you can step through the phases of the key agreement protocol using the doPhase() method. Once the phases are complete, the secret value (that is, the key) is returned from the generateSecret() method.

Class Definition

public class javax.crypto.KeyAgreement
	extends java.lang.Object {

	// Constructors
	protected KeyAgreement(KeyAgreementSpi, Provider, String);

	// Class Methods
	public static final KeyAgreement getInstance(String);
	public static final KeyAgreement getInstance(String, String);

	// Instance Methods
	public final Key doPhase(Key, boolean);
	public final byte[] generateSecret();
	public final int generateSecret(byte[], int);
	public final String getAlgorithm();
	public final Provider getProvider();
	public final void init(Key);
	public final void init(Key, SecureRandom);
	public final void init(Key, AlgorithmParameterSpec);
	public final void init(Key, AlgorithmParameterSpec, SecureRandom);
}

See also:

AlgorithmParameterSpec, Key, KeyAgreementSpi, Provider, SecureRandom

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