I tried to search online for the difference between both CSR certificate and a certificate but I couldn't find a concrete asnwer. I am doing my own lab using this tutorial https://www.golinuxcloud.com/openssl-create-certificate-chain-linux/.
I noticed for root CA we create a certificate, however for the intermediate CA we create CSR certificate and I can't tell what is the difference. And when reading both files I noticed that they are totally different even though both are certificate (.pem)
To create CA certficate:
openssl req -config openssl_root.cnf -key ~/myCA/rootCA/private/ca.key.pem -new -x509 -days 7300 -sha256 -extensions v3_ca -out ~/myCA/rootCA/certs/ca_cert.pem -subj "/C=US/ST=California/L=San Francisco/O=Example Corp/OU=IT Department/CN=Root CA"
to read CA certificate :
openssl x509 -noout -text -in ca_cert.pem
to create CSR certificate:
openssl req -config openssl_intermediate.cnf -key ~/myCA/intermediateCA/private/intermediate.key.pem -new -sha256 -out ~/myCA/intermediateCA/certs/intermediate.csr.pem -subj "/C=US/ST=California/L=San Francisco/O=Example Corp/OU=IT Department/CN=Intermediate CA"
to read CSR certificate:
openssl req -in intermediate_csr.pem -noout -text