Configuring the Protector
Configuring AP Java on Linux
To configure the AP Java on the Linux platform:
Setup the Java classpath.
Operating System Classpath Linux /opt/protegrity/sdk/java/libBefore the trusted application can successfully load the
ApplicationProtectorJava.jarfile, ensure that -- The Java
classpathis set accurately. - The path to
jcorelite.plmis configured properly.
- The Java
Deploy a policy to test the application.
For more information about deploying a policy, refer to Deploying Policies.
For more information about configuring the various parameters for the AP Java using the config.ini file, refer to Config.ini file for Application Protector.
Verifying Installation of AP Java
The steps to verify the successful installation of the AP Java are described in this section.
Configure the application as a trusted application in the ESA.
For more information about trusted applications, refer to Working With Trusted Applications.Initialize AP Java.
For more information about the AP Java initialization API, refer to getProtector.Run the
GetVersionmethod using the following command to check the version of the installed AP Java.public java.lang.String getVersion()
Before running the following program, update the GetVersion.java file with the policy username and data element name.
Compile and Run the Sample Application
Compile the sample application using the following command.
cd /opt/protegrity/sdk/java/lib
javac -cp .:ApplicationProtectorJava.jar GetVersion.java
Run the sample application using the following command.
java -cp .:ApplicationProtectorJava.jar GetVersion
By default, the config.ini file is located in the SDK data directory /opt/protegrity/sdk/java/data and is picked up automatically at runtime.
If the config.ini file is moved to a different location, specify its path explicitly when running the application:
java -Dconfig.path=/opt/config.ini -cp .:ApplicationProtectorJava.jar GetVersion
If config.ini is present in the same directory as ApplicationProtectorJava.jar and jcorelite.plm, the SDK loads it automatically and the -Dconfig.path option is not required.
The following is a sample code to check the version number of the installed AP Java.
/* Illustrates how to call getVersion() api to know the version of Application Protector
* Executing this for the first time creates a forensic entry that should be added to the authorized app
*
*/
import com.protegrity.ap.java.*;
public class GetVersion {
public static void main(String[] args) throws ProtectorException {
Protector protector=null;
try {
protector=Protector.getProtector();
System.out.println("Product version : "+protector.getVersion());
} catch (ProtectorException e) {
e.printStackTrace();
throw e;
}
}
}
Feedback
Was this page helpful?