#!/bin/bash

file=$1
echo $file
fname=${file%\.*}
echo $fname


#openssl pkcs12 -nocerts -in (filename).p12 -out userkey.pem
openssl pkcs12 -nocerts -in $file -out userkey_$fname.pem

#openssl pkcs12 -nokeys -clcerts -in (filename).p12 -out usercert.pem
openssl pkcs12 -nokeys -clcerts -in $file -out usercert_$fname.pem

#openssl pkcs12 -nokeys -cacerts -in (filename).p12 -out userca.pem 
openssl pkcs12 -nokeys -cacerts -in $file -out userca_$fname.pem

