March 3, 2009

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]#

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: