3 openssl rsa -text -in key.priv.pem 2>/dev/null |\
4 sed 's/^Private//;T;d' |\
6 sed 's/privateExponent:.*//' |\
7 sed 's/publicExponent:/\npublicExponent:/' |\
9 sed 's/publicExponent:\([^(]*\)(.*/\1/' |\
10 sed 's/^modulus://' |\
16 echo 'static BN_ULONG e_1[] = {' $exponent', };'
18 echo -n 'static BN_ULONG n_1[] = {'
19 modulus=$(echo $modulus | sed 's/^00//')
20 echo $modulus | sed 's/\(........\)/\t0x\1,\n/g' | tac