Adding multithreading support to the application
[aaf/sshsm.git] / bin / caservicecontainer / multithreadapplication.sh
1 #!/bin/bash
2
3 # This script takes 4 arguments
4 key_label=$1
5 SoftHSMv2SlotID=$2
6 upin=$3
7 cert_id=$4
8
9 # Location to fecth SoftHSM library required by application
10 applicationlibrary="/usr/local/lib/softhsm/libsofthsm2.so"
11
12 # Setting up the java application and running the application
13 # 1. Create the configuration pkcs11.cfg for the application
14 # Remove any existing cfg file first from the CWD
15 rm -f pkcs11.cfg
16 touch pkcs11.cfg
17 chmod 755 pkcs11.cfg
18 echo "name = ${key_label}" >> pkcs11.cfg
19 echo "The location of applicationms library is ${applicationlibrary}"
20 echo "library = ${applicationlibrary}" >> pkcs11.cfg
21 echo "slot = ${SoftHSMv2SlotID}" >> pkcs11.cfg
22
23 # 2. Compile the Application
24 # CaSign requires test.csr to be available in CWD
25 javac CaSignMultiThread.java
26
27 # 3. Run the Application
28 java CaSignMultiThread ${upin} 0x${cert_id}