aboutsummaryrefslogtreecommitdiffstats
path: root/bin/caservicecontainer/application.sh
diff options
context:
space:
mode:
authorPramod Raghavendra Jayathirth <pramod.raghavendra.jayathirth@intel.com>2018-08-27 09:05:45 -0700
committerPramod Raghavendra Jayathirth <pramod.raghavendra.jayathirth@intel.com>2018-09-04 08:37:12 -0700
commita0865eeaad17733a2d21cc141fba168663c9f539 (patch)
tree1951c969c43bf5335eeea8d75003168179b52935 /bin/caservicecontainer/application.sh
parenta5c07a62289e05e3fc7ee0d3baa702c8c3299356 (diff)
Script for SoftHSMv2 fallback mechanism
This will facilitate the SoftHSMv2 implementation when TPM is unavailable Change-Id: Ic77627702db514213cece200a259f723e6d66d34 Issue-ID: AAF-414 Signed-off-by: Pramod Raghavendra Jayathirth <pramod.raghavendra.jayathirth@intel.com>
Diffstat (limited to 'bin/caservicecontainer/application.sh')
-rwxr-xr-xbin/caservicecontainer/application.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/bin/caservicecontainer/application.sh b/bin/caservicecontainer/application.sh
new file mode 100755
index 0000000..1a723ea
--- /dev/null
+++ b/bin/caservicecontainer/application.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+# This script takes 4 arguments
+key_label=$1
+SoftHSMv2SlotID=$2
+upin=$3
+cert_id=$4
+
+# Location to fecth SoftHSM library required by application
+applicationlibrary="/usr/local/lib/softhsm/libsofthsm2.so"
+
+# Setting up the java application and running the application
+# 1. Create the configuration pkcs11.cfg for the application
+touch /tmp/pkcs11.cfg
+chmod 755 /tmp/pkcs11.cfg
+echo "name = ${key_label}" >> /tmp/pkcs11.cfg
+echo "The location of applicationms library is ${applicationlibrary}"
+echo "library = ${applicationlibrary}" >> /tmp/pkcs11.cfg
+echo "slot = ${SoftHSMv2SlotID}" >> /tmp/pkcs11.cfg
+
+# 2. Compile the Application
+cd /tmp/files
+cp test.csr /tmp/test.csr
+javac CaSign.java
+
+# 3. Run the Application
+java CaSign ${upin} 0x${cert_id}
+
+# 4. Verify the generated certificate
+openssl verify -verbose -CAfile ca.cert /tmp/test.cert \ No newline at end of file