1 .TH PKI 1 "2013-07-31" "@PACKAGE_VERSION@" "strongSwan"
5 pki \- Simple public key infrastructure (PKI) management tool
11 .RI [ option\~ .\|.\|.]
23 is a suite of commands that allow you to manage a simple public key
26 Generate RSA and ECDSA key pairs, create PKCS#10 certificate requests
27 containing subjectAltNames, create X.509 self-signed end-entity and root CA
28 certificates, issue end-entity and intermediate CA certificates signed by the
29 private key of a CA and containing subjectAltNames, CRL distribution points
30 and URIs of OCSP servers. You can also extract raw public keys from private
31 keys, certificate requests and certificates and compute two kinds of SHA-1-based
38 Prints usage information and a short summary of the available commands.
41 Generate a new private key.
44 Create a self-signed certificate.
47 Issue a certificate using a CA certificate and key.
50 Issue a CRL using a CA certificate and key.
53 Issue an attribute certificate.
56 Create a PKCS#10 certificate request.
59 Provides PKCS#7 wrap/unwrap functions.
62 Calculate key identifiers of a key or certificate.
65 Print a credential (key, certificate etc.) in human readable form.
68 Extract a public key from a private key or certificate.
71 Verify a certificate using a CA certificate.
75 .SS "Generating a CA Certificate"
77 The first step is to generate a private key using the
79 command. By default this generates a 2048-bit RSA key.
82 pki \-\-gen > ca_key.der
85 This key is used to create the self-signed CA certificate, using the
87 command. The distinguished name should be adjusted to your needs.
90 pki \-\-self \-\-ca \-\-in ca_key.der \\
91 \-\-dn "C=CH, O=strongSwan, CN=strongSwan CA" > ca_cert.der
95 .SS "Generating End-Entity Certificates"
97 With the root CA certificate and key at hand end-entity certificates for clients
98 and servers can be issued. Similarly intermediate CA certificates can be issued,
99 which in turn can issue other certificates.
100 To generate a certificate for a server, we start by generating a private key.
103 pki \-\-gen > server_key.der
106 The public key will be included in the certificate so lets extract that from the
110 pki \-\-pub \-\-in server_key.der > server_pub.der
113 The following command will use the CA certificate and private key to issue the
114 certificate for this server. Adjust the distinguished name, subjectAltName(s)
115 and flags as needed (check
116 .BR pki\ \-\-issue (8)
120 pki \-\-issue \-\-in server_pub.der \-\-cacert ca_cert.der \\
121 \-\-cakey ca_key.der \-\-dn "C=CH, O=strongSwan, CN=VPN Server" \\
122 \-\-san vpn.strongswan.org \-\-flag serverAuth > server_cert.der
125 Instead of storing the public key in a separate
128 may also be piped directly into the above command.
130 .SS "Generating Certificate Revocation Lists (CRL)"
132 If end-entity certificates have to be revoked, CRLs may be generated using
138 pki \-\-signcrl \-\-cacert ca_cert.der \-\-cakey ca_key.der \\
139 \-\-reason superseded \-\-cert server_cert.der > crl.der
142 The certificate given with \-\-cacert must be either a CA certificate or a
145 extended key usage (\-\-flag crlSign). URIs to CRLs may be included in issued
146 certificates with the \-\-crl option.
150 .BR pki\ \-\-gen (1),
151 .BR pki\ \-\-self (1),
152 .BR pki\ \-\-issue (1),
153 .BR pki\ \-\-signcrl (1),
154 .BR pki\ \-\-acert (1),
155 .BR pki\ \-\-req (1),
156 .BR pki\ \-\-pkcs7 (1),
157 .BR pki\ \-\-keyid (1),
158 .BR pki\ \-\-print (1),
159 .BR pki\ \-\-pub (1),
160 .BR pki\ \-\-verify (1)