Panopticon Sample Program
Panopticon includes a sample program, written in Java, which demonstrates how to use Panopticon through the Java API. The sample program determines the type of encryption used to encrypt a file and, if possible, decrypts the file.
The source code for the sample program, and a compiled PanopticonSample.jar, are located in install\javaapi\sample, where install is the path to your copy of the Panopticon SDK.
Before you can compile the program from the source code, you must replace the string YOUR_KEYVIEW_LICENSE with your license key.
NOTE: The compiled PanopticonSample.jar has an embedded trial license, which expires approximately five months after release. If you set the environment variable KV_SAMPLE_PROGRAM_LICENSE_FROM_FILEPATH to a file path, the sample program reads your license from the specified file. This allows you to use the program after the embedded trial license has expired, and to test or troubleshoot with your own license.
When you run the program using the provided shell scripts, the working directory must be the install\javaapi\sample folder.
To run the sample program
-
Open a command prompt in the
javaapi\sampledirectory. -
Run the program:
-
Directly
java -Djava.library.path="bin_path" -jar PanopticonSample.jar bin_path tenant_id client_id client_secret input_file output_file
-
Using the Windows shell script
PanopticonSample.bat bin_path tenant_id client_id client_secret input_file output_file
-
Using the Linux shell script
PanopticonSample.sh bin_path tenant_id client_id client_secret input_file output_file
The arguments are as follows.
bin_pathThe path to the Panopticon bindirectory.tenant_idYour Microsoft Azure tenant ID. client_idThe application client ID for authentication with Azure. client_secretThe application client secret for authentication with Azure. input_fileThe path of the file to decrypt. output_fileThe path and file name to use for the decrypted file. -