CSI-ES-2324/Projs/PD2/certs
afonso 49a29e43a7
[PD2] Server done?
Co-authored-by: tsousa111 <tiagao2001@hotmail.com>
2024-05-28 20:13:33 +01:00
..
CA [PD2] Server done? 2024-05-28 20:13:33 +01:00
client1 [PD2] Server done? 2024-05-28 20:13:33 +01:00
client2 [PD2] Server done? 2024-05-28 20:13:33 +01:00
client3 [PD2] Server done? 2024-05-28 20:13:33 +01:00
FakeCA [PD2] Server done? 2024-05-28 20:13:33 +01:00
FakeClient1 [PD2] Server done? 2024-05-28 20:13:33 +01:00
FakeServer [PD2] Server done? 2024-05-28 20:13:33 +01:00
server [PD2] Server done? 2024-05-28 20:13:33 +01:00
README.md [PD2] Server done? 2024-05-28 20:13:33 +01:00

Generating keys

  1. Generate CA key and certificate:
openssl genrsa -aes256 -out CA/CA.key 4096
openssl req -x509 -new -nodes -key CA/CA.key -sha256 -days 18250 -out CA/CA.pem -subj "/2.5.4.3=CA"

The CA passphrase is 1234

  1. Generate server key and CSR:
openssl genrsa -out server/server.key 4096
openssl req -new -key server/server.key -out server/server.csr -subj "/2.5.4.11=MSG SERVICE/2.5.4.65=SERVER"
  1. Sign the server CSR with CA:
openssl x509 -req -in server/server.csr -CA CA/CA.pem -CAkey CA/CA.key -CAcreateserial -out server/server.crt -days 1825 -sha256
  1. Generate the server's keystore:
openssl pkcs12 -export -out server/server.p12 -inkey server/server.key -in server/server.crt -certfile CA/CA.pem -name "ServerKeyStore"

The passphrase used for the keystore is server

  1. Generate each client's key and CSR:
openssl genrsa -out client{NUM}/client{NUM}.key 4096
openssl req -new -key client{NUM}/client{NUM}.key -out client{NUM}/client{NUM}.csr -subj "/2.5.4.11=MSG SERVICE/2.5.4.65=CL{NUM}/2.5.4.3=Client {NUM}"
  1. Sign the client CSR with CA:
openssl x509 -req -in client/client.csr -CA CA/CA.pem -CAkey CA/CA.key -CAcreateserial -out client/client.crt -days 1825 -sha256
  1. Generate the client's keystore:
openssl pkcs12 -export -out client{NUM}/client{NUM}.p12 -inkey client{NUM}/client{NUM}.key -in client{NUM}/client{NUM}.crt -certfile CA/CA.pem -name "Client{NUM}KeyStore"

The passphrase used for the keystore is client{NUM}