#!/usr/pkg/bin/bash key=$1 if [ ! "$key" ]; then echo "Usage: $0 CN_key.pem # where CN is the Common Name of the entity" exit 1 fi cn=`echo $key | sed -e 's/_key.pem$//'` openssl rsa -in $key -out ${cn}_key_unlocked.pem