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 SecretKey generateSecret(String);
	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

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.