#!/bin/sh ##Convert IGCA .p12 cert into .pem file P12=$1 KEY="$HOME/.globus/userkey.pem" CERT="$HOME/.globus/usercert.pem" if [ -z "$P12" ] ; then echo "Usage: $0 " exit fi if [ ! -r "$P12" ] ; then echo "$P12 not readable" exit fi # make sure $HOME/.globus is there mkdir -p $HOME/.globus echo "Generating your public cert : Enter the password you set during .p12 export from browser" openssl pkcs12 -clcerts -nokeys -in $P12 -out $CERT chmod 644 $CERT echo echo "Generating your private key : : Enter the password you set during .p12 export from browser" # Make sure key is writable if [ -r $KEY ] ; then chmod 600 $KEY fi openssl pkcs12 -nocerts -in $P12 -out $KEY chmod 400 $KEY echo "Your usercert.pem and userkey.pem is stored inside .globus folder"