Builder
class Builder
kotlin.Any | |
↳ | android.net.ipsec.ike.ChildSaProposal.Builder |
This class is used to incrementally construct a ChildSaProposal. ChildSaProposal instances are immutable once built.
Summary
Public constructors | |
---|---|
Builder() |
Public methods | |
---|---|
ChildSaProposal.Builder |
addDhGroup(dhGroup: Int) Adds a Diffie-Hellman Group to the SA proposal being built. |
ChildSaProposal.Builder |
addEncryptionAlgorithm(algorithm: Int, keyLength: Int) Adds an encryption algorithm with a specific key length to the SA proposal being built. |
ChildSaProposal.Builder |
addIntegrityAlgorithm(algorithm: Int) Adds an integrity algorithm to the SA proposal being built. |
ChildSaProposal |
build() Validates and builds the ChildSaProposal. |
Public constructors
Public methods
addDhGroup
fun addDhGroup(dhGroup: Int): ChildSaProposal.Builder
Adds a Diffie-Hellman Group to the SA proposal being built.
If this ChildSaProposal will be used for the first Child SA created as part of IKE AUTH exchange, DH groups configured here will only apply when the Child SA is later rekeyed. In this case, configuring different DH groups for IKE and Child SA may cause Rekey Child to fail.
If no DH groups are supplied here, but the server requests a DH exchange during rekey, the IKE SA's negotiated DH group will still be accepted.
Return | |
---|---|
ChildSaProposal.Builder |
Builder of ChildSaProposal. This value cannot be null . |
addEncryptionAlgorithm
fun addEncryptionAlgorithm(
algorithm: Int,
keyLength: Int
): ChildSaProposal.Builder
Adds an encryption algorithm with a specific key length to the SA proposal being built.
Parameters | |
---|---|
algorithm |
Int: encryption algorithm to add to ChildSaProposal. Value is android.net.ipsec.ike.SaProposal#ENCRYPTION_ALGORITHM_3DES , android.net.ipsec.ike.SaProposal#ENCRYPTION_ALGORITHM_AES_CBC , android.net.ipsec.ike.SaProposal#ENCRYPTION_ALGORITHM_AES_CTR , android.net.ipsec.ike.SaProposal#ENCRYPTION_ALGORITHM_AES_GCM_8 , android.net.ipsec.ike.SaProposal#ENCRYPTION_ALGORITHM_AES_GCM_12 , android.net.ipsec.ike.SaProposal#ENCRYPTION_ALGORITHM_AES_GCM_16 , or android.net.ipsec.ike.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. |
Return | |
---|---|
ChildSaProposal.Builder |
Builder of ChildSaProposal. This value cannot be null . |
addIntegrityAlgorithm
fun addIntegrityAlgorithm(algorithm: Int): ChildSaProposal.Builder
Adds an integrity algorithm to the SA proposal being built.
Return | |
---|---|
ChildSaProposal.Builder |
Builder of ChildSaProposal. This value cannot be null . |
build
fun build(): ChildSaProposal
Validates and builds the ChildSaProposal.
Return | |
---|---|
ChildSaProposal |
the validated ChildSaProposal. This value cannot be null . |