A CSR is a file containing your certificate application information, including your Public Key. Generate keys and certificate: To generate a pair of private key and public Certificate Signing Request (CSR) for a webserver, "server", use the following command :
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/private.key -out /etc/ssl/certs/cert.crt
This creates a two files. The file myserver.key contains a private key; do not disclose this file to anyone. Carefully protect the private key.
You can easily decode your CSR to see what is in CSR.
openssl req -in server.csr -noout -text
You can easily decode your CRT to see what is in CRT.
openssl x509 -in server.crt -noout -text