4 # presumes standard directory of strongswan
7 VPN_IP_ADDRESS="45.32.241.182"
10 echo "Entering strongswan config directory..."
11 cd /etc/strongswan/ipsec.d/
13 echo -n "Enter a username: "
16 echo -n "Enter an email (identity): "
19 strongswan pki --gen --type rsa --size 2048 \
21 > private/${USR_NAME}Key.pem
22 chmod 600 private/${USR_NAME}Key.pem
23 strongswan pki --pub --in private/${USR_NAME}Key.pem --type rsa | \
24 strongswan pki --issue --lifetime 730 \
25 --cacert cacerts/strongswanCert.pem \
26 --cakey private/strongswanKey.pem \
27 --dn "C=$VPN_COUNTRY, O=$VPN_NAME, CN=$IDENTITY" \
29 --outform pem > certs/${USR_NAME}Cert.pem
31 echo "Exporting to a PKCS12 file..."
33 openssl pkcs12 -export -inkey private/${USR_NAME}Key.pem \
34 -in certs/${USR_NAME}Cert.pem -name "${USR_NAME}'s Certifcate" \
35 -certfile cacerts/strongswanCert.pem \