1 all: agent1-cert.pem agent2-cert.pem agent3-cert.pem
5 # Create Certificate Authority: ca1
6 # ('password' is used for the CA password.)
9 openssl req -new -x509 -config ca1.cnf -keyout ca1-key.pem -out ca1-cert.pem
12 # Create Certificate Authority: ca2
13 # ('password' is used for the CA password.)
16 openssl req -new -x509 -config ca2.cnf -keyout ca2-key.pem -out ca2-cert.pem
20 # agent1 is signed by ca1.
24 openssl genrsa -out agent1-key.pem
26 agent1-csr.pem: agent1.cnf agent1-key.pem
27 openssl req -new -config agent1.cnf -key agent1-key.pem -out agent1-csr.pem
29 agent1-cert.pem: agent1-csr.pem ca1-cert.pem ca1-key.pem
31 -passin "pass:password" \
39 # agent2 has a self signed cert
41 # Generate new private key
43 openssl genrsa -out agent2-key.pem
45 # Create a Certificate Signing Request for the key
46 agent2-csr.pem: agent2-key.pem agent2.cnf
47 openssl req -new -config agent2.cnf -key agent2-key.pem -out agent2-csr.pem
49 # Create a Certificate for the agent.
50 agent2-cert.pem: agent2-csr.pem agent2-key.pem
53 -signkey agent2-key.pem \
58 # agent3 is signed by ca2.
62 openssl genrsa -out agent3-key.pem
64 agent3-csr.pem: agent3.cnf agent3-key.pem
65 openssl req -new -config agent3.cnf -key agent3-key.pem -out agent3-csr.pem
67 agent3-cert.pem: agent3-csr.pem ca2-cert.pem ca2-key.pem
69 -passin "pass:password" \