patrick@mockingjay:~$ mkdir my-ca
patrick@mockingjay:~$ cd my-ca/
patrick@mockingjay:~/my-ca$ mkdir ca server client
patrick@mockingjay:~/my-ca$ cd ca/
patrick@mockingjay:~/my-ca/ca$ openssl genrsa -aes256 -out ca.key 4096
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
~/my-ca/ca$ openssl req -x509 -new -nodes -key ca.key -sha256 -days 3650 -out ca.crt
Enter pass phrase for 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) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:
Email Address []:
patrick@mockingjay:~/my-ca/ca$ cd ..
patrick@mockingjay:~/my-ca$ cd server/
patrick@mockingjay:~/my-ca/server$ openssl req -new -nodes -out goshs.csr -newkey rsa:4096 -keyout goshs.key
.......[output omitted]
-----
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) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:
Email Address []:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
patrick@mockingjay:~/my-ca/server$ openssl x509 -req -in goshs.csr -CA ../ca/ca.crt -CAkey ../ca/ca.key -CAcreateserial -out goshs.crt -days 3650 -sha256
Certificate request self-signature ok
subject=C = AU, ST = Some-State, O = Internet Widgits Pty Ltd
Enter pass phrase for ../ca/ca.key:
patrick@mockingjay:~/my-ca/server$ ll
total 12K
-rw-r--r-- 1 user user 1.8K Jul 7 15:00 goshs.crt
-rw-r--r-- 1 user user 1.7K Jul 7 14:59 goshs.csr
-rw------- 1 user user 3.2K Jul 7 14:59 goshs.key
patrick@mockingjay:~/my-ca/server$ openssl pkcs12 -export -inkey goshs.key -in goshs.crt -out goshs.p12
Enter Export Password:
Verifying - Enter Export Password:
patrick@mockingjay:~/my-ca/server$ cd ..
patrick@mockingjay:~/my-ca$ cd client/
patrick@mockingjay:~/my-ca/client$ openssl req -new -nodes -out chrome.csr -newkey rsa:4096 -keyout chrome.key
.+.......[output omitted]
-----
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) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:
Email Address []:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
patrick@mockingjay:~/my-ca/client$ openssl x509 -req -in chrome.csr -CA ../ca/ca.crt -CAkey ../ca/ca.key -CAcreateserial -out chrome.crt -days 3650 -sha256
Certificate request self-signature ok
subject=C = AU, ST = Some-State, O = Internet Widgits Pty Ltd
Enter pass phrase for ../ca/ca.key:
patrick@mockingjay:~/my-ca/client$ openssl pkcs12 -export -inkey chrome.key -in chrome.crt -out chrome.p12
Enter Export Password:
Verifying - Enter Export Password:
patrick@mockingjay:~/my-ca/client$ ll
total 20K
-rw-r--r-- 1 user user 1.8K Jul 7 15:01 chrome.crt
-rw-r--r-- 1 user user 1.7K Jul 7 15:01 chrome.csr
-rw------- 1 user user 3.2K Jul 7 15:01 chrome.key
-rw------- 1 user user 4.1K Jul 7 15:01 chrome.p12