Cerca

Creazione del CSR

Verifica del certificato CSR:

openssl req -text -noout -verify -in CSR.csr

Creazione del certificato CSR e della chiave privata:

openssl req -out CSR.csr -new -newkey rsa:2048 -nodes -keyout privateKey.key

Creazione del certificato CSR da una chiave privata esistente:

openssl req -out CSR.csr -key privateKey.key -new

E possibile verificare che il file certificato restituito dal Provider (certificate.crt) e' valido per la chiave privata:

openssl x509 -noout -modulus -in certificate.crt | openssl md5
openssl rsa -noout -modulus -in privateKey.key | openssl md5
openssl req -noout -modulus -in CSR.csr | openssl md5

Esempio 1

Nel esempio viene aggiunto un nuovo attributo "uri" che puo' essere aggiunto ma non nel distinguished name (dn) ma nell'alternatives name che sono stati introdotti nella versione 3 dello schema X509.

File di configurazione (server.conf):

[ req ]
distinguished_name = dn
req_extensions=req_ext
prompt = no

[ dn ]
organizationName=Azienda S.P.A.
commonName=Azienda
organizationIdentifier=000000000
countryName=IT
localityName=Citta

[ req_ext ]
subjectAltName=@spid

[spid]
URI.1=https://spid.user.it/pub-ag-lite/citta

Eseguire il comando:

openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr -config server.conf

Esempio 2

Nel esempio viene aggiunto un nuovo attributo "uri" nel distinguished name (dn) definendo un nuovo OID uri.

File di configurazione (server.conf):

oid_section = OIDs

[ req ]
distinguished_name = dn
prompt = no

[OIDs]
uri=2.5.4.83

[ dn ]
organizationName=Azienda S.P.A.
commonName=Azienda
organizationIdentifier=000000000
countryName=IT
givenName=OK
localityName=Citta
uri=https://spid.user.it/pub-ag-lite/citta

Eseguire il comando:

openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr -config server.conf

Esempio 3

Creazione di un semplice CSR:

openssl req -out siab.csr -new -newkey rsa:2048 -nodes -keyout siab_pk.key

​ Country Name (2 letter code) [AU]:IT ​ State or Province Name (full name) [Some-State]:Italy ​ Locality Name (eg, city) []:Basilicata ​ Organization Name (eg, company) [Internet Widgits Pty Ltd]:Azienda ​ Organizational Unit Name (eg, section) []:Ufficio ​ Common Name (e.g. server FQDN or YOUR name) []:www.dominio.it ​ Email Address []:test@test.it

​ Please enter the following 'extra' attributes ​ to be sent with your certificate request ​ A challenge password []: ​ An optional company name []:

​ Il valore alla Common Name e' da considerare com server FQDN per l'uso come SSL ​ Common Name (e.g. server FQDN or YOUR name) []: www.dominio.it

Verificare se il certificato pubblico rilasciato dalla CA e' riferito a specifico certificato di chiave privata:

openssl x509 -noout -modulus -in 249ee6698a74ae21.crt | openssl md5
openssl rsa -noout -modulus -in siab_pk.key | openssl md5
Indietro