pki tool is a command-line utility for managing the full lifecycle of X.509 certificates and private keys used in IKEv2 VPN authentication. It can generate keys, build certificate authorities, issue end-entity certificates, sign CRLs, and inspect or verify existing credentials — all without depending on OpenSSL’s openssl CLI.
Subcommands
| Command | Description |
|---|---|
pki --gen | Generate a private key (RSA, ECDSA, Ed25519, Ed448) |
pki --self | Create a self-signed CA certificate from a private key |
pki --issue | Issue a signed end-entity certificate using a CA key and cert |
pki --req | Create a PKCS#10 certificate signing request (CSR) |
pki --signcrl | Sign a Certificate Revocation List |
pki --print | Print the contents of a certificate, CRL, or key |
pki --verify | Verify a certificate’s signature chain |
pki --pub | Extract the public key from a private key |
pki --pkcs12 | Create or extract PKCS#12 bundles |
pki --pkcs7 | PKCS#7 container operations |
pki --acert | Issue attribute certificates |
pki --dn | Extract the distinguished name from a certificate |
pki --keyid | Compute the key identifier of a key or certificate |
pki --ocsp | Perform OCSP requests |
pki --scep | SCEP certificate enrollment |
pki --est | EST certificate enrollment |
pki --help or pki <subcommand> --help for full option documentation.
Supported key types
| Type | Sizes / Curves | Notes |
|---|---|---|
| RSA | 2048, 3072, 4096 bits | Traditional; use 3072+ for new deployments |
| ECDSA | 256, 384, 521 bits | NIST P-curves; good performance and security |
| Ed25519 | 256 bits | Recommended for new CAs and host keys |
| Ed448 | 448 bits | Higher security margin EdDSA variant |
Output formats
Allpki commands that write credentials support --outform:
der— Binary ASN.1 DER (default for most commands)pem— Base64 PEM (human-readable, preferred for config files)
File locations under /etc/swanctl/
strongSwan’sswanctl loads credentials from a well-known directory tree:
Where to go next
CA Setup
Generate a CA key and self-signed root certificate.
Generating Certificates
Issue host and user certificates signed by your CA.
CRL Management
Sign and distribute Certificate Revocation Lists.