Setting-up a Simple CA Using the strongSwan PKI Tool » History » Version 1

Version 1/40 - Next » - Current version
Martin Willi, 16.09.2009 11:23

Setup a simple CA

This How-To sets up a Certificate Authority using the strongSwan PKI tool, keeping it as simple as possible.

CA certificate

First, generate a private key, the default generates a 2048 bit RSA key:

ipsec pki --gen > cakey.der

For a real-world setup, make sure to keep this key private.

Now self-sign a CA certificate using the generated key:

ipsec pki --self --in cakey.der --dn "C=CH, O=strongSwan, CN=CA" --ca > cacert.der

Adjust the distinguished name to your needs, it will be included in all issued certificates.

That's it, your CA is ready to issue certificates.

End entity certificates

For each peer, generate a private key and issue a certificate using your new CA:

ipsec pki --gen > peerkey.der

ipsec pki --pub --in peerkey.der | ipsec pki --issue --cacert cacert.der \
   --cakey cakey.der --dn "C=CH, O=strongSwan, CN=peer" 

The second command extracts the public key and issues a certificate using your CA. Distribute private key and certificate to your peer.