IT Security Lab - PKI
IT Security Lab - PKI
Fundamentals of IT Security
Assignment : Public Key Infrastructure
Group members:
Section - 1
December, 2021
Task 1 Becoming a Certificate Authority(CA)
The above command generates a private key, stored in ca.key, and the
public-key certificate is stored in ca.crt.
The above two images show portions of what has been written to ca.crt
and ca.key respectively.
Based on the output of the above two we can answer the following
questions:
The above shows the issuer and the subject to be the same
proving self-signed.
Using the CA we made above, we now want to get a public key certificate for our
website. For this to happen, we first need to generate a Certificate Signing
Request (CSR). This CSR will be sent to the CA, which will verify the information
sent in this request and generate a certificate if it is valid.
In the above image, we have added the flag and generated the key
along with the desired alternative domains which will be shown more in
the next task.
Task 3: Generating a Certificate for our server
The CSR file needs to have CA’s signature in order to be/form a certificate. So we
need to convert our CSR (server.csr) into a valid certificate by sending it to our CA
and using it’s ca.crt and ca.key. The following image shows how that is done.
In the command, myCA_openssl.cnf is the file we copied in the first section of the
lab into our own directory and made modifications to. To make it have less
restrictions we use the policy_anything policy. To copy extension field from the
request to the final certificate, one modification we need to do is to uncomment
one line from our copy of openssl.cnf (myCA_openssl.cnf) to allow us to make the
copy. We can then check the certificate and also notice here that the alternative
names we added earlier are here as well.
In the above image we can see that the certificate is generated and it also contains
the list of the alternative names that we gave it.
One problem that we ran into when trying to access the site using HTTPS however,
was that the browser doesn’t trust our CA and the certificate that it generates. So
we need to add this in our browser under trusted certificates for it to work
properly every time.