[root@localhost ssl]# umask 077
[root@localhost ssl]# openssl genrsa -des3 -out certs/segw.key 2048
Generating RSA private key, 2048 bit long modulus
..............................+++
...........................................................................................................................+++
e is 65537 (0x10001)
Enter pass phrase for certs/segw.key:
Verifying - Enter pass phrase for certs/segw.key:
[root@localhost ssl]# umask 022
[root@localhost ssl]# openssl req -new -key certs/segw.key -out certs/segw.csr
Enter pass phrase for certs/segw.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]:FR
State or Province Name (full name) [Berkshire]:Alpes-Maritimes
Locality Name (eg, city) [Newbury]:Sophia-Antipolis
Organization Name (eg, company) [My Company Ltd]:3GPP
Organizational Unit Name (eg, section) []:SEGW
Common Name (eg, your name or your server's hostname) []:Provisioning
Email Address []:.

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
[root@localhost ssl]# mkdir -p demoCA/newcerts
[root@localhost ssl]# touch demoCA/index.txt
[root@localhost ssl]# echo "01" > demoCA/serial
[root@localhost ssl]# umask 022
[root@localhost ssl]# openssl genrsa -des3 -out certs/ca.key 2048
Generating RSA private key, 2048 bit long modulus
.................................................+++
...................................+++
e is 65537 (0x10001)
Enter pass phrase for certs/ca.key:
Verifying - Enter pass phrase for certs/ca.key:
[root@localhost ssl]# openssl req -days 3650 -x509 -key certs/ca.key -set_serial 01 -new > certs/ca.crt
Enter pass phrase for certs/ca.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]:FR
State or Province Name (full name) [Berkshire]:Alpes-Maritimes
Locality Name (eg, city) [Newbury]:Sophia-Antipolis
Organization Name (eg, company) [My Company Ltd]:3GPP
Organizational Unit Name (eg, section) []:3GPP
Common Name (eg, your name or your server's hostname) []:Mobile Competence Centre
Email Address []:.
[root@localhost ssl]# umask 022
[root@localhost ssl]# openssl ca -in certs/segw.csr -keyfile certs/ca.key -cert certs/ca.crt -out certs/segw.crt
Using configuration from /usr/share/ssl/openssl.cnf
Enter pass phrase for certs/ca.key:
Check that the request matches the signature
Signature ok
Certificate Details:
        Serial Number: 1 (0x1)
        Validity
            Not Before: Feb  7 10:15:22 2007 GMT
            Not After : Feb  4 10:15:22 2017 GMT
        Subject:
            countryName               = FR
            stateOrProvinceName       = Alpes-Maritimes
            localityName              = Sophia-Antipolis
            organizationName          = 3GPP
            organizationalUnitName    = SEGW
            commonName                = Provisioning
        X509v3 extensions:
            X509v3 Basic Constraints:
            CA:FALSE
            X509v3 Key Usage:
            Digital Signature
            X509v3 Subject Alternative Name:
            DNS:psgw.gan.mnc001.mcc001.3gppnetwok.org, IP Address:192.168.11.32
Certificate is to be certified until Feb  4 10:15:22 2017 GMT (3650 days)
Sign the certificate? [y/n]:y


1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated
[root@localhost ssl]#

