Since: API level 11
public class

PermissionApplicationPrivateKey

extends Object
implements Parcelable
java.lang.Object
   ↳ com.samsung.android.knox.keystore.PermissionApplicationPrivateKey

Class Overview

This class contains information needed to allow an application to access private keys without prompting the user for such permission.

Since
API level 11
KNOX 2.0

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Public Constructors
PermissionApplicationPrivateKey(String packageName, String host, int port, String alias)
The constructor of the permission object, containing the needed values to give an application the permission of reading private keys from VPN and Apps keystore.
PermissionApplicationPrivateKey(String packageName, String host, int port, String alias, String storageName)
The constructor of the permission object, containing the needed values to give an application the permission of reading private keys from a specific credential storage.
Public Methods
String getAdminPkgName()
API to get the package name of the administrator that added this permission.
String getAlias()
API to get the alias of the private key that was granted to an application.
String getHost()
API to get the host of the server that received this permission.
String getPackageName()
API to get the package name of the application that received this permission.
int getPort()
API to get the port of the server that received this permission.
String getStorageName()
API to get the credential storage name of private key that was granted to an application.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Public Constructors

public PermissionApplicationPrivateKey (String packageName, String host, int port, String alias)

Since: API level 11

The constructor of the permission object, containing the needed values to give an application the permission of reading private keys from VPN and Apps keystore.

Parameters
packageName The application to receive the permission of reading private keys. It will not work with any kind of wildcard or regular expression.
host The server host which the application claims that will receive the private key. Usually, applications will provide domain names as host names. The policy will grant access if the host provided by the application ends with the domain provided by an administrator.

Example: an application provides subsystem.securesite.com and it will match to securesite.com, so the application will receive access to a given private key.

It also accepts a string with one asterisk ("*") as a wildcard, but it will not work with regular expressions. When this wildcard is used, the application may request the access providing any host regardless of the port provided, and it will always receive the same private key alias.

port The server port which the application claims that will receive the private key. It accepts the value -1 as a wildcard. When this wildcard is used, the application may request the access providing any port, and it will always receive the same private key alias.
alias The installed private key from VPN and Apps keystore which access will be allowed to the application.
Since
API level 11
KNOX 2.0

public PermissionApplicationPrivateKey (String packageName, String host, int port, String alias, String storageName)

Since: API level 11

The constructor of the permission object, containing the needed values to give an application the permission of reading private keys from a specific credential storage.

Parameters
packageName The application to receive the permission of reading private keys. It will not work with any kind of wildcard or regular expression.
host The server host which the application claims that will receive the private key. Usually, applications will provide domain names as host names. The policy will grant access if the host provided by the application ends with the domain provided by an administrator.

Example: an application provides subsystem.securesite.com and it will match to securesite.com, so the application will receive access to a given private key.

It also accepts a string with one asterisk ("*") as a wildcard, but it will not work with regular expressions. When this wildcard is used, the application may request the access providing any host regardless of the port provided, and it will always receive the same private key alias.

port The server port which the application claims that will receive the private key. It accepts the value -1 as a wildcard. When this wildcard is used, the application may request the access providing any port, and it will always receive the same private key alias.
alias The installed private key which access will be allowed to the application.
storageName The credential storage name of private key which access will be allowed to the application. Private key will be accessed from VPN and Apps keystore if null or an empty String value is passed.
The parameter storageName can be retrieved via name field of CredentialStorage object. This CredentialStorage object is obtained using getAvailableCredentialStorages().
Since
API level 19
KNOX 2.6

Public Methods

public String getAdminPkgName ()

Since: API level 11

API to get the package name of the administrator that added this permission.

Returns
  • the package name of the administrator that added this permission.
Usage
An administrator can use this API to check which administrator added this permission.
Since
API level 11
KNOX 2.0

public String getAlias ()

Since: API level 11

API to get the alias of the private key that was granted to an application.

Returns
  • the alias of the private key that was granted to an application.
Usage
An administrator can use this API to check which private key was permitted to an application.
Since
API level 11
KNOX 2.0

public String getHost ()

Since: API level 11

API to get the host of the server that received this permission.

Returns
  • the host of the server that received this permission.
Usage
An administrator can use this API to check which host:port server received this permission.
Since
API level 11
KNOX 2.0

public String getPackageName ()

Since: API level 11

API to get the package name of the application that received this permission.

Returns
  • the package name of the application that received this permission.
Usage
An administrator can use this API to check which application received this permission.
Since
API level 11
KNOX 2.0

public int getPort ()

Since: API level 11

API to get the port of the server that received this permission.

Returns
  • the port of the server that received this permission.
Usage
An administrator can use this API to check which host:port server received this permission.
Since
API level 11
KNOX 2.0

public String getStorageName ()

Since: API level 19

API to get the credential storage name of private key that was granted to an application.

Returns
  • the credential storage name of private key that was granted to an application.
Usage
An administrator can use this API to check the credential storage name of private key permitted to an application.
Since
API level 19
KNOX 2.6