Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit feb69c13 authored by Benedict Wong's avatar Benedict Wong
Browse files

Add Ikev2VpnProfile as public API

This change adds configuration classes for Platform VPNs, with the
extensibility for further platform VPNs to be added in future.

Profile validity is checked upon construction, and upon changing
conversion from VpnProfile instances. Internal storage and method calls
all use VpnProfiles to allow for reuse of existing infrastructure.
However, when Platform VPN implementations are started, the internal
VpnProfile will be converted back into the respective
PlatformVpnProfile for validity checking.

Bug: 143325939
Test: Compiles, FrameworksNetTests passing.
Change-Id: I3c375fb08c132fc062e893c375f5c36460122162
parent 50b147d8
Loading
Loading
Loading
Loading
+37 −0
Original line number Diff line number Diff line
@@ -28866,6 +28866,35 @@ package android.net {
    field public final int code;
  }
  public final class Ikev2VpnProfile extends android.net.PlatformVpnProfile {
    method @NonNull public java.util.List<java.lang.String> getAllowedAlgorithms();
    method public int getMaxMtu();
    method @Nullable public String getPassword();
    method @Nullable public byte[] getPresharedKey();
    method @Nullable public android.net.ProxyInfo getProxyInfo();
    method @Nullable public java.security.PrivateKey getRsaPrivateKey();
    method @NonNull public String getServerAddr();
    method @Nullable public java.security.cert.X509Certificate getServerRootCaCert();
    method @Nullable public java.security.cert.X509Certificate getUserCert();
    method @NonNull public String getUserIdentity();
    method @Nullable public String getUsername();
    method public boolean isBypassable();
    method public boolean isMetered();
  }
  public static final class Ikev2VpnProfile.Builder {
    ctor public Ikev2VpnProfile.Builder(@NonNull String, @NonNull String);
    method @NonNull public android.net.Ikev2VpnProfile build();
    method @NonNull public android.net.Ikev2VpnProfile.Builder setAllowedAlgorithms(@NonNull java.util.List<java.lang.String>);
    method @NonNull public android.net.Ikev2VpnProfile.Builder setAuthDigitalSignature(@NonNull java.security.cert.X509Certificate, @NonNull java.security.PrivateKey, @Nullable java.security.cert.X509Certificate);
    method @NonNull public android.net.Ikev2VpnProfile.Builder setAuthPsk(@NonNull byte[]);
    method @NonNull public android.net.Ikev2VpnProfile.Builder setAuthUsernamePassword(@NonNull String, @NonNull String, @Nullable java.security.cert.X509Certificate);
    method @NonNull public android.net.Ikev2VpnProfile.Builder setBypassable(boolean);
    method @NonNull public android.net.Ikev2VpnProfile.Builder setMaxMtu(int);
    method @NonNull public android.net.Ikev2VpnProfile.Builder setMetered(boolean);
    method @NonNull public android.net.Ikev2VpnProfile.Builder setProxy(@Nullable android.net.ProxyInfo);
  }
  public class InetAddresses {
    method public static boolean isNumericAddress(@NonNull String);
    method @NonNull public static java.net.InetAddress parseNumericAddress(@NonNull String);
@@ -29212,6 +29241,14 @@ package android.net {
    field public String response;
  }
  public abstract class PlatformVpnProfile {
    method public final int getType();
    method @NonNull public final String getTypeString();
    field public static final int TYPE_IKEV2_IPSEC_PSK = 7; // 0x7
    field public static final int TYPE_IKEV2_IPSEC_RSA = 8; // 0x8
    field public static final int TYPE_IKEV2_IPSEC_USER_PASS = 6; // 0x6
  }
  public final class Proxy {
    ctor public Proxy();
    method @Deprecated public static String getDefaultHost();