IkeSaProposal.Builder


public static final class IkeSaProposal.Builder
extends Object

java.lang.Object
   ↳ android.net.ipsec.ike.IkeSaProposal.Builder


This class is used to incrementally construct a IkeSaProposal. IkeSaProposal instances are immutable once built.

Summary

Public constructors

Builder()

Public methods

IkeSaProposal.Builder addDhGroup(int dhGroup)

Adds a Diffie-Hellman Group to the SA proposal being built.

IkeSaProposal.Builder addEncryptionAlgorithm(int algorithm, int keyLength)

Adds an encryption algorithm with a specific key length to the SA proposal being built.

IkeSaProposal.Builder addIntegrityAlgorithm(int algorithm)

Adds an integrity algorithm to the SA proposal being built.

IkeSaProposal.Builder addPseudorandomFunction(int algorithm)

Adds a pseudorandom function to the SA proposal being built.

IkeSaProposal build()

Validates and builds the IkeSaProposal.

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public constructors

Builder

Added in API level 31
public Builder ()

Public methods

addDhGroup

Added in API level 31
public IkeSaProposal.Builder addDhGroup (int dhGroup)

Adds a Diffie-Hellman Group to the SA proposal being built.

Returns
IkeSaProposal.Builder Builder of IkeSaProposal. This value cannot be null.

addEncryptionAlgorithm

Added in API level 31
public IkeSaProposal.Builder addEncryptionAlgorithm (int algorithm, 
                int keyLength)

Adds an encryption algorithm with a specific key length to the SA proposal being built.

Parameters
algorithm int: encryption algorithm to add to IkeSaProposal. Value is SaProposal.ENCRYPTION_ALGORITHM_3DES, SaProposal.ENCRYPTION_ALGORITHM_AES_CBC, SaProposal.ENCRYPTION_ALGORITHM_AES_CTR, SaProposal.ENCRYPTION_ALGORITHM_AES_GCM_8, SaProposal.ENCRYPTION_ALGORITHM_AES_GCM_12, SaProposal.ENCRYPTION_ALGORITHM_AES_GCM_16, or SaProposal.ENCRYPTION_ALGORITHM_CHACHA20_POLY1305

keyLength int: key length of algorithm. For algorithms that have fixed key length (e.g. 3DES) only SaProposal.KEY_LEN_UNUSED is allowed.

Returns
IkeSaProposal.Builder Builder of IkeSaProposal. This value cannot be null.

addIntegrityAlgorithm

Added in API level 31
public IkeSaProposal.Builder addIntegrityAlgorithm (int algorithm)

Adds an integrity algorithm to the SA proposal being built.

Returns
IkeSaProposal.Builder Builder of IkeSaProposal. This value cannot be null.

addPseudorandomFunction

Added in API level 31
public IkeSaProposal.Builder addPseudorandomFunction (int algorithm)

Adds a pseudorandom function to the SA proposal being built.

Returns
IkeSaProposal.Builder Builder of IkeSaProposal. This value cannot be null.

build

Added in API level 31
public IkeSaProposal build ()

Validates and builds the IkeSaProposal.

Returns
IkeSaProposal the validated IkeSaProposal. This value cannot be null.