# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Ctors | Methods | Inherited Methods

# IpSecTransform.Builder

`public static class IpSecTransform.Builder`
`extends Object` ``

java.lang.Object
↳ | android.net.IpSecTransform.Builder

This class is used to build `IpSecTransform` objects.

## Summary

### Public constructors
`Builder(Context context)` Create a new IpSecTransform.Builder.

### Public methods
`IpSecTransform` | `buildTransportModeTransform(InetAddress sourceAddress, IpSecManager.SecurityParameterIndex spi)` Build a transport mode `IpSecTransform`.
`IpSecTransform.Builder` | `setAuthenticatedEncryption(IpSecAlgorithm algo)` Set the authenticated encryption algorithm.
`IpSecTransform.Builder` | `setAuthentication(IpSecAlgorithm algo)` Set the authentication (integrity) algorithm.
`IpSecTransform.Builder` | `setEncryption(IpSecAlgorithm algo)` Set the encryption algorithm.
`IpSecTransform.Builder` | `setIpv4Encapsulation(IpSecManager.UdpEncapsulationSocket localSocket, int remotePort)` Add UDP encapsulation to an IPv4 transform.

### Inherited methods
From class `java.lang.Object`
`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 timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public constructors

### Builder

    public Builder (Context context)

Create a new IpSecTransform.Builder.

Parameters
`context` | `Context`: current context This value cannot be `null`.

## Public methods

### buildTransportModeTransform

    public IpSecTransform buildTransportModeTransform (InetAddress sourceAddress,
                    IpSecManager.SecurityParameterIndex spi)

Build a transport mode `IpSecTransform`.

This builds and activates a transport mode transform. Note that an active transform will not affect any network traffic until it has been applied to one or more sockets.

Parameters
`sourceAddress` | `InetAddress`: the source `InetAddress` of traffic on sockets that will use this transform; this address must belong to the Network used by all sockets that utilize this transform; if provided, then only traffic originating from the specified source address will be processed. This value cannot be `null`.
`spi` | `IpSecManager.SecurityParameterIndex`: a unique `IpSecManager.SecurityParameterIndex` to identify transformed traffic This value cannot be `null`.

Returns
`IpSecTransform` | This value cannot be `null`.

Throws
`IllegalArgumentException` | indicating that a particular combination of transform properties is invalid
`IpSecManager.ResourceUnavailableException` | indicating that too many transforms are active
`IpSecManager.SpiUnavailableException` | indicating the rare case where an SPI collides with an existing transform
`IOException` | indicating other errors

See also:

- `IpSecManager.applyTransportModeTransform(FileDescriptor, int, IpSecTransform)`

### setAuthenticatedEncryption

    public IpSecTransform.Builder setAuthenticatedEncryption (IpSecAlgorithm algo)

Set the authenticated encryption algorithm.

The Authenticated Encryption (AE) class of algorithms are also known as Authenticated Encryption with Associated Data (AEAD) algorithms, or Combined mode algorithms (as referred to in RFC 4301).

Authenticated encryption is mutually exclusive with encryption and authentication.

Parameters
`algo` | `IpSecAlgorithm`: `IpSecAlgorithm` specifying the authenticated encryption algorithm to be applied. This value cannot be `null`.

Returns
`IpSecTransform.Builder` | This value cannot be `null`.

### setAuthentication

    public IpSecTransform.Builder setAuthentication (IpSecAlgorithm algo)

Set the authentication (integrity) algorithm.

Authentication is mutually exclusive with authenticated encryption.

Parameters
`algo` | `IpSecAlgorithm`: `IpSecAlgorithm` specifying the authentication to be applied. This value cannot be `null`.

Returns
`IpSecTransform.Builder` | This value cannot be `null`.

### setEncryption

    public IpSecTransform.Builder setEncryption (IpSecAlgorithm algo)

Set the encryption algorithm.

Encryption is mutually exclusive with authenticated encryption.

Parameters
`algo` | `IpSecAlgorithm`: `IpSecAlgorithm` specifying the encryption to be applied. This value cannot be `null`.

Returns
`IpSecTransform.Builder` | This value cannot be `null`.

### setIpv4Encapsulation

    public IpSecTransform.Builder setIpv4Encapsulation (IpSecManager.UdpEncapsulationSocket localSocket,
                    int remotePort)

Add UDP encapsulation to an IPv4 transform.

This allows IPsec traffic to pass through a NAT.

Parameters
`localSocket` | `IpSecManager.UdpEncapsulationSocket`: a socket for sending and receiving encapsulated traffic This value cannot be `null`.
`remotePort` | `int`: the UDP port number of the remote host that will send and receive encapsulated traffic. In the case of IKEv2, this should be port 4500.

Returns
`IpSecTransform.Builder` | This value cannot be `null`.

See also:

- RFC 3948, UDP Encapsulation of IPsec ESP Packets
- RFC 7296 section 2.23, NAT Traversal of IKEv2

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*