8 OPT="-days 3653 -sha256"
10 # generate self-signed root
11 $OPENSSL ecparam -name prime256v1 -genkey -out 00.key
12 $OPENSSL req -new -x509 -subj "/C=UK/O=mbed TLS/CN=CA00" $OPT \
13 -key 00.key -out 00.crt
15 # cXX.pem is the chain starting at XX
20 while [ $i -le $NB ]; do
21 UP=$( printf "%02d" $((i-1)) )
22 ME=$( printf "%02d" $i )
24 $OPENSSL ecparam -name prime256v1 -genkey -out ${ME}.key
25 $OPENSSL req -new -subj "/C=UK/O=mbed TLS/CN=CA${ME}" \
26 -key ${ME}.key -out ${ME}.csr
27 $OPENSSL x509 -req -CA ${UP}.crt -CAkey ${UP}.key -set_serial 1 $OPT \
28 -extfile int.opensslconf -extensions int \
29 -in ${ME}.csr -out ${ME}.crt
31 cat ${ME}.crt c${UP}.pem > c${ME}.pem