March 3, 2009

Generating SSL certificate without passphrase

Posted in SSL at 3:33 pm by alessiodini


The steps for creating a certificate without passphrase are:

1)

openssl genrsa -des3 -out server.key 1024 => creates a key useful for certificate

Generating RSA private key, 1024 bit long modulus
…………++++++
…….++++++
e is 65537 (0x10001)
Enter pass phrase for server.key:
Verifying – Enter pass phrase for server.key:
[root@sia root]#

2)

openssl rsa -in server.key -out server.pem => used for delete the passphrase

Enter pass phrase for server.key:
writing RSA key
[root@sia root]#

3)

openssl req -new -nodes -key server.pem -out server.csr => as key is passed server.pem that it has no passphrase 🙂

You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
—–
Country Name (2 letter code) [GB]:IT
State or Province Name (full name) [Berkshire]:Lazio
Locality Name (eg, city) [Newbury]:Roma
Organization Name (eg, company) [My Company Ltd]:System01 S.P.A
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server’s hostname) []:vamweb.system01.it
Email Address []:sistemisti@system01.it

Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
[root@sia root]#

4)

openssl x509 -req -days 365 -in server.csr -signkey server.pem -out server.crt

Signature ok
subject=/C=IT/ST=Lazio/L=Roma/O=System01 S.P.A/OU=Regione Lazio/CN=vamweb.system01.it/emailAddress=sistemisti@system01.it
Getting Private key
[root@sia root]#

Advertisements

Generating SSL certificate with passphrase

Posted in SSL at 3:30 pm by alessiodini


The steps for creating a certificate with passphrase are:

1)

openssl genrsa -des3 -out server.key 1024 => creates a key useful for certificate

Generating RSA private key, 1024 bit long modulus
…………++++++
…….++++++
e is 65537 (0x10001)
Enter pass phrase for server.key:
Verifying – Enter pass phrase for server.key:
[root@sia root]#

2)

openssl req -new -key server.key -out server.csr

Enter pass phrase for server.key:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
—–
Country Name (2 letter code) [GB]:IT
State or Province Name (full name) [Berkshire]:Lazio
Locality Name (eg, city) [Newbury]:Roma
Organization Name (eg, company) [My Company Ltd]:System01 S.P.A
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server’s hostname) []:vamweb.system01.it <— common name must be the same of the server hostname!
Email Address []:sistemisti@system01.it

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

3)

openssl x509 -req -days 60 -in server.csr -signkey server.key -out server.crt

Signature ok
subject=/C=IT/ST=Lazio/L=Roma/O=System01 S.P.A/CN=vamweb.system01.it/emailAddress=sistemisti@system01.it
Getting Private key
Enter pass phrase for server.key:
[root@sia root]#