Example CA, Intermediate, and Server Certificate

# Create CA
openssl genrsa -out ca.key 4096
openssl req -new -x509 -nodes -sha1 -days 1825 -key ca.key -out ca.crt

# Create Intermediate
openssl genrsa -out intermediate.key 4096
openssl req -new -sha1 -key intermediate.key -out intermediate.csr

# CA signs Intermediate
openssl x509 -req -days 1825 -in intermediate.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out intermediate.crt

# Create Server
openssl genrsa -out test.example.com.key 4096
openssl req -new -key test.example.com.key -out test.example.com.csr

# Intermediate signs Server
openssl x509 -req -days 1825 -in test.example.com.csr -CA intermediate.crt -CAkey intermediate.key -set_serial 01 -out test.example.com.crt
  Name Size Creator (Last Modifier) Creation Date Last Mod Date Comment  
File intermediate.crt 2 kB Gene Wood Feb 22, 2013 Feb 22, 2013 Intermediate Certificate
File intermediate.csr 2 kB Gene Wood Feb 22, 2013 Feb 22, 2013 Intermediate Certificate Signing Request
File ca.key 3 kB Gene Wood Feb 22, 2013 Feb 22, 2013 CA Key
File ca.crt 2 kB Gene Wood Feb 22, 2013 Feb 22, 2013 CA Certificate
File intermediate.key 3 kB Gene Wood Feb 22, 2013 Feb 22, 2013 Intermediate Key
File test.example.com.key 3 kB Gene Wood Feb 22, 2013 Feb 22, 2013 Test Server Key
File test.example.com.csr 2 kB Gene Wood Feb 22, 2013 Feb 22, 2013 Test Server Certificate Signing Request
File test.example.com.crt 2 kB Gene Wood Feb 22, 2013 Feb 22, 2013 Test Server Certificate

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.