---
title: Android Interface Definition Language (AIDL)
slug: isac/admin-guide/android/android-interface-definition-language-aidl
docTags: 
createdAt: 2026-07-23T05:01:25.249Z
---

The AIDL file used to define the client interface is named *IVpnProfile.aidl* and contains the following:

```bash
package net.pulsesecure.pulsesecure.vpnprofile;
```

```bash
//Package name updated in API version 3.
 interface IVpnProfile {
 int doCommand(String commandXML); //deprecated
 int getVersion();
 // The following methods were added in API version 2.
int createConnection(String jsonProfile);
int removeConnection(String profileName);
List<String> getAllConnections();
String getConnection(String profileName);
int startConnection(String profileName);
 int stopConnection(String profileName);
 int getState(String profileName);
 String getErrorString(String profileName);
```

This file must be included in the src/ directory used to compile the application. For more information about the AIDL, go to [aidl.html](http://developer.android.com/guide/components/aidl.html).

### Service intent filter action name

Use below action name to bind to service implementing this API. Updated in API version 3.

```bash
"net.pulsesecure.pulsesecure.vpnprofile.IVpnProfile"
```

### JSON String Format for createConnection

The createConnection method, new in version 2 of the API, accepts a VPN profile described in a JSON string format.

The JSON strings vary depending on the type of authentication used in the VPN profile, as shown in the following examples.

### Single Username/Password Authentication

The following sample JSON string is for a VPN profile that uses a username/password for authentication:

```bash
{
 "MDM_VPN_PARAMETERS": {
 "profile_attribute": {
 "profileName":"MyVpnProfile",
 "host":"https://vpn.xyz.com/auth",
 "vpn_type":"ssl",
 "isUserAuthEnabled":true
 },
 "ssl": {
.. "basic": {
 "username":"testuser",
 "password":"secret123"
 }
 },
 "vendor": {
 "realm":"",
 "role":"",
 "certAlias":""
 }
 }
 }
```

### Certificate Authentication

The following sample JSON string is for a VPN profile that uses a certificate for authentication:

```bash
{
 "MDM_VPN_PARAMETERS": {
 "profile_attribute": {
 "profileName":"MyVpnProfile",
 "host":"https://vpn.xyz.com/auth",
 "vpn_type":"ssl",
 "isUserAuthEnabled":true
 },
 "ssl": {
 "basic": {
 }
 },
 "vendor": {
 "realm":"",
 "role":"",
 "certAlias":"myCertName"
 }
 }
 }
```

:::hint{type="info"}
The certificate must be installed in Android’s keystore before this profile can be used. The certificate name is specified in the certAlias field in the vendor section.
:::

### Username/Password and Certificate Authentication

The following sample JSON string is for a VPN profile that uses both certificate and username/password for authentication:

```bash
{
 "MDM_VPN_PARAMETERS": {
 "profile_attribute": {
 "profileName":"MyVpnProfile",
 "host":"https://vpn.xyz.com/auth",
 "vpn_type":"ssl",
 "isUserAuthEnabled":true
 },
 "ssl": {
 "basic": {
 "username":"testuser",
 "password":"secret123"
 }
 },
 "vendor": {
 "realm":"",
 "role":"",
 "certAlias":"myCertName"
 }
 }
 }
```

### Dual Username/Password Authentication

The following sample JSON string is for a VPN profile that uses two usernames/passwords for authentication:

```bash
{
 "MDM_VPN_PARAMETERS": {
 "profile_attribute": {
 "profileName":"MyVpnProfile",
 "host":"https://vpn.xyz.com/auth",
 "vpn_type":"ssl",
 "isUserAuthEnabled":true
 },
 "ssl": {
 "basic": {
 "username":"testuser",
 "password":"secret123"
 }
 },
 "vendor": {
 "realm":"",
 "role":"",
 "username2":"testuser2",
 "password2":"passwd123"
 }
 }
 }
```

:::hint{type="info"}
The primary username/password are specified in the ssl section and the secondary username/password are specified in the vendor section.
:::

### XML Command Format for doCommand (Deprecated)

Many commands are specified by the commandXML argument of the interface doCommand. For a single command, the general format is:

```bash
<command>
 <commandName>command</commandName>
 <param1>value1</param1>
 <param2>value2</param2>
 // additional parameters for the command
 </command>
```

Any parameter that is specified with an empty value is ignored.

The commandXML argument should specify a single command. However, multiple commands can be specified as follows:

```bash
<commands>
 <command>
 .
 .
 .
 </command>
 <command>
 .
 .
 .
 </command>
</commands>
```

Multiple commands are executed in the order specified, and execution stops on the first error. The doCommand method returns a negative integer if an error occurs on the first command; otherwise, the number of commands executed successfully is returned. If an error occurs after the first command, it is logged in the Pulse client log.

### Return Codes for doCommand

The doCommand method returns a negative integer if an error occurs or a positive value (1 or higher) to indicate the number of commands executed successfully. The following table lists all of the possible return codes.

| Return Code | Description                              |
| ----------- | ---------------------------------------- |
| 1 or n      | Number of commands executed successfully |
| -1          | COMMAND\_EXECUTION\_ERROR                |
| -2          | COMMAND\_UNKNOWN                         |
| -3          | KEY\_OR\_CERT\_UNEXPECTED                |
| -4          | KEY\_OR\_CERT\_MISSING                   |
| -5          | PROFILE\_DELETE\_FAILED                  |
| -6          | PROFILE\_UPDATE\_FAILED                  |
| -7          | PROFILE\_ADD\_FAILED                     |
| -8          | PROFILE\_NOT\_FOUND                      |
| -9          | PROFILE\_ALREADY\_EXISTS                 |
| -10         | COMMAND\_XML\_INVALID                    |
| -11         | COMMAND\_NOT\_SUPPORTED                  |
| -12         | CALLER\_NOT\_VERIFIED                    |
| -13         | CALLER\_NOT\_IDENTIFIED                  |
| -14         | CERT\_ALIAS\_NOT\_FOUND\_IN\_KEYSTORE    |
| -15         | INCORRECT\_BASE64\_KEY\_OR\_CERT         |
| -16         | INCORRECT\_KEY\_OR\_CERT\_FILE           |
| -17         | DUPLICATE\_KEY\_OR\_CERT\_ENTRIES        |
| -18         | REQUIRED\_PARAMETER\_MISSING             |
| -19         | CHECK\_PROFILE\_URL\_MISMATCH            |
| -20         | CHECK\_PROFILE\_USERNAME\_MISMATCH       |
| -21         | CHECK\_PROFILE\_REALM\_MISMATCH          |
| -22         | CHECK\_PROFILE\_ROLE\_MISMATCH           |
| -23         | CHECK\_PROFILE\_CERT\_PATH\_MISMATCH     |
| -24         | CHECK\_PROFILE\_KEY\_PATH\_MISMATCH      |
| -25         | CHECK\_PROFILE\_CERT\_ALIAS\_MISMATCH    |
