#!/bin/bash

output=$1".bin"
output1=$1".bin1"
echo "Creating ............."
echo $output

openssl rsa -pubin -in $1 -modulus -noout -out $output 
sed -i 's/Modulus=//g' $output
openssl rsa -pubin -in $1 -text -noout -out $output1
var=`cat $output1 | grep "Exponent:" | awk '{print $2}'`
expo=$(printf "%08x" $var)
echo $expo >> $output
xxd -r -p $output > $output1
mv $output1 $output
