Assuming the CSR (Certificate Signing Request) is stored in a file called
example.csr, you can use the following OpenSSL command to display the details of the CSR.
$ openssl req -noout -text -in example.csr Certificate Request: Data: Version: 0 (0x0) Subject: CN=www.simonecarletti.com, O=Simone Carletti, L=Rome, ST=RM, C=IT Subject Public Key Info: ... Signature Algorithm: sha256WithRSAEncryption
Signature Algorithm represents the hash algorithm used to sign the CSR.
$ openssl req -noout -text -in example.csr | grep 'Signature Algorithm' Signature Algorithm: sha256WithRSAEncryption
If the value is
sha256WithRSAEncryption, the certificate is using SHA-256 (also known as SHA-2). Another common value is
sha1WithRSAEncryption, that means the certificate is signed with SHA-1.
If you already received a certificate, you can check if the certificate is a SHA-2 certificate.