#!/bin/bash -x

rm -rf ca_data
# The root CA
make init topca=mgr.testbed.aaa

# General-use client and server
make newcert ca=mgr.testbed.aaa name=client
make newcert ca=mgr.testbed.aaa name=client2
make newcert ca=mgr.testbed.aaa name=server

# Simple testbed; cli is created twice to get it revoked
make newca ca=mgr.testbed.aaa name=simple.testbed.aaa
make newcert ca=simple.testbed.aaa name=cli.simple.testbed.aaa
make newcert ca=simple.testbed.aaa name=serv.simple.testbed.aaa
make newcert ca=simple.testbed.aaa name=cli.simple.testbed.aaa

# Piotr case: using IP addresses
make init topca=CA
make newcert ca=CA name=192.168.102.10
make newcert ca=CA name=192.168.102.20

# RT testbed
make newca ca=mgr.testbed.aaa name=rt.testbed.aaa
make newca ca=rt.testbed.aaa name=a.rt.testbed.aaa
make newcert ca=a.rt.testbed.aaa name=nas.a.rt.testbed.aaa
make newcert ca=a.rt.testbed.aaa name=relay.a.rt.testbed.aaa
make newcert ca=a.rt.testbed.aaa name=proxy.a.rt.testbed.aaa

make newca ca=rt.testbed.aaa name=b.rt.testbed.aaa
make newcert ca=b.rt.testbed.aaa name=proxy.b.rt.testbed.aaa
make newcert ca=b.rt.testbed.aaa name=relay.b.rt.testbed.aaa
make newcert ca=b.rt.testbed.aaa name=serv.b.rt.testbed.aaa

make newca ca=rt.testbed.aaa name=c.rt.testbed.aaa
make newcert ca=c.rt.testbed.aaa name=relay.c.rt.testbed.aaa
make newcert ca=c.rt.testbed.aaa name=proxy.c.rt.testbed.aaa

# EAP testbed
make newca ca=mgr.testbed.aaa name=eap.testbed.aaa
make newcert ca=eap.testbed.aaa name=gw.eap.testbed.aaa
make newcert ca=eap.testbed.aaa name=backend.eap.testbed.aaa
make newcert ca=eap.testbed.aaa name=supauth2.eap.testbed.aaa

# Interop testbed
make newca ca=mgr.testbed.aaa name=iop.testbed.aaa
make newcert ca=iop.testbed.aaa name=fdrelay.iop.testbed.aaa
make newcert ca=iop.testbed.aaa name=crcumcli.iop.testbed.aaa
make newcert ca=iop.testbed.aaa name=crcumsrv.iop.testbed.aaa

