I have been having a headache for a long time trying to get this to work. My goal is to create a self signed CA that I can use to create x509 certs so I can install them in two apple ios devices so the two devices can share digitally signed and encrypted emails below is the commands that I have been trying. I'm new to openssl and I would need a bit of explaining. Any help will be most welcome.
Here is the commands that I'm using
openssl req -x509 -config openssl-ca.cnf -newkey rsa:4096 -days 4000 -sha512 -nodes -out cacert.pem -outform PEM
openssl req -config openssl-server.cnf -newkey rsa:4096 -sha512 -nodes -out servercert.csr -outform PEM
echo '01' > serial.txt
openssl ca -config openssl-ca.cnf -policy signing_policy -extensions signing_req -out servercert.pem -infiles servercert.csr
openssl pkcs12 -export -in cacert.pem -inkey cakey.pem -out CA.p12 -name "mykey"
openssl pkcs12 -export -in servercert.pem -inkey serverkey.pem -out email4.p12 -name "email"
CA and Server config file is located here http://pastebin.com/QVy9ivGg