Summary: Ctors | Methods | Inherited Methods
public
static
class
IpSecTransform.Builder
extends Object
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.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
| |||||||||||||||||||||||
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 | |
|---|---|
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 |
IllegalArgumentException |
indicating that a particular combination of transform properties is invalid |
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. |