Documentation Index
Fetch the complete documentation index at: https://mintlify.com/strongswan/strongswan/llms.txt
Use this file to discover all available pages before exploring further.
pki --req creates a PKCS#10 Certificate Signing Request (CSR) from a private key. The CSR can then be submitted to a CA using pki --issue.
Synopsis
Options
Path to the private key file (PEM or DER). Read from stdin if omitted.
Hex-encoded CKA_ID of a private key on a token. Use instead of
--in for HSM/smartcard-backed keys.Input key type. Accepted values:
priv (auto-detect), rsa, ecdsa.Subject Distinguished Name in RFC 4514 format, for example:
Subject Alternative Name. Can be specified multiple times.
| Format | Example |
|---|---|
| FQDN | moon.strongswan.org |
carol@strongswan.org | |
| IPv4 address | 192.168.0.1 |
| IPv6 address | fec0::1 |
Extended Key Usage flag to include in the CSR. Can be specified multiple times. Accepted values:
serverAuth, clientAuth, ocspSigning, msSmartcardLogon.Digest algorithm for the CSR signature (e.g.
sha256, sha384, sha512). Defaults to an algorithm appropriate for the key type.RSA padding scheme. Use
pss for RSASSA-PSS.Certificate profile to request. Passed as an extension in the CSR.
Path to a previous CSR to use as input. Extracts the public key from the existing request.
Output encoding format. Accepted values:
pem, der.Write the CSR to the specified file path. If omitted, output goes to stdout.
Examples
Create a CSR for a VPN gateway:The CSR contains the subject’s DN, SANs, and public key, signed by the subject’s private key to prove possession. The CA may override the DN and SANs when issuing the certificate.
Pass the resulting CSR to
pki --issue --type pkcs10 --in moonReq.pem to sign it with a CA.