STRONGSWAN_PKI---EST(1)

πŸ“¦
version 6.0.7 Β· 4 versions
, in fedora 43, fedora 44

🌸 PKI --EST(1) β€” the strongSwan glow-up 🌸

okay bestie, you found the manual page for pki --est, a.k.a. PKI --EST(1) in the strongSwan fam. This is the one that goes and gets you a certificate from an EST server, and honestly? it's giving ✨*secure enrollment*✨. Let's get into it, no gatekeeping πŸ’…


✨ NAME ✨

pki --est β€” Enroll an X.509 certificate with an EST server πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

pki --est ---url url [--label label] [--in file] --cacert file [--cert
          file|--certid hex --key file|--keyid hex]
          [--userpass username:password] [--interval time]
          [--maxpolltime time] [--outform encoding] [--debug level]

pki --est --options file

pki --est -h | --help
heads up: that first line literally says ---url with three dashes, bestie. I'm not fixing it, I'm just reporting it. Copy-paste responsibly πŸ™ˆ

πŸ’– DESCRIPTION πŸ’–

So this is a sub-command of pki(1) (iykyk), and what it does is send a PKCS#10 certificate request over HTTPS to a server using the Enrollment over Secure Transport (EST) Protocol (RFC 7030). Iconic behavior fr fr.

After the authorization goes through β€” and ngl, with manual authentication that means the enrollment client has to poll periodically, like a bestie refreshing the group chat for a reply β€” the EST server hands back an X.509 certificate signed by the CA. πŸŽ‰

And here's the cute part: before your current certificate expires, you can request a brand-new client certificate based on a fresh private key. How does it authenticate, you ask? It uses the old certificate and the old key for automatic TLS client authentication with the EST server. Main character energy, honestly. πŸ‘‘


πŸ’… OPTIONS πŸ’…

  • -h, --help β€” prints usage info with a lil summary of everything available. your friendly little map πŸ—ΊοΈ
  • -v, --debug level β€” sets the debug level, and the default is 1.
  • -+, --options file β€” reads command line options from a file. yes, the flag is literally -+. slay.
  • -u, --url url β€” the URL of the EST server. where we're headed πŸ›«
  • -l, --label label β€” the label in the EST server path.
  • -i, --in file β€” the PKCS#10 certificate request. If you don't give one, it gets read from STDIN. no file? fine, pipe it in, we're flexible πŸ’œ
  • -C, --cacert file β€” a CA certificate in the trust chain used for EST TLS server signature verification, or in the trust chain to verify the client certificate issued by the CA. You can use this one multiple times. stack 'em up 🧚
  • -c, --cert file β€” the client certificate to be renewed.
  • -X, --certid hex β€” smartcard or TPM 2.0 client certificate object handle.
  • -k, --key file β€” the client private key to be replaced.
  • -x, --keyid hex β€” smartcard or TPM 2.0 client private key object handle.
  • -p, --userpass username:password β€” optional username:password that may be used for HTTP basic authentication.
  • -t, --interval time β€” poll interval in seconds, defaults to 60s. And plot twist: this value might get overridden by the retry-after header in the HTTP 202 reply from the EST server. the server said "actually, wait this long" πŸ’€
  • -m, --maxpolltime time β€” maximum poll time in seconds, defaults to 0 which means unlimited polling. forever and ever, bestie 🫢
  • -f, --outform encoding β€” encoding of the created certificate file. Either der (ASN.1 DER) or pem (Base64 PEM), and it defaults to der.

🌈 EXAMPLES 🌈

To save some typing work (we love efficiency ✨), the following command line options are stored in a est.opt file:

--url https://pki.strongswan.org:8443
--cacert tlsca.crt
--cacert tlsca-1.crt
--cacert myca.crt
--cacert myca-1.crt
NOTE: For a successful HTTPS connection, trust must be established into the EST server certificate. The TLS trust chain including the root CA certificate and optionally intermediate CA certificates must be given using multiple --cacert options. don't skip this, it will Not Work 🚨

The --cacert option must also be used to be able to verify the received client certificate issued by the CA. This second trust chain might be identical to the TLS trust chain (if the EST server is using a TLS server certificate issued by its own CA) or might be totally different, e.g. if a Let's Encrypt EST server certificate is used. two chains, two vibes, both valid 🌸

With the following command, an X.509 certificate signed by the intermediate CA is requested from an EST server based on a PKCS#10 certificate request:

pki --options est.opt --in moonReq.der > moonCert.der

and the output is genuinely so satisfying to read, look:

negotiated TLS 1.3 using suite TLS_AES_256_GCM_SHA384
received TLS server certificate 'C=CH, O=strongSwan Project, CN=pki.strongswan.org'
  using certificate "C=CH, O=strongSwan Project, CN=pki.strongswan.org"
  using trusted intermediate ca certificate "C=CH, O=strongSwan Project, CN=strongSwan Issuing CA"
  using trusted ca certificate "C=CH, O=strongSwan Project, CN=strongSwan Root CA"
  reached self-signed root ca with a path length of 1
  EST request pending, polling indefinitely every 300 seconds
  going to sleep for 300 seconds
  ...
Issued certificate "C=CH, O=strongSwan Project, CN=moon.strongswan.org"
  serial: 1a:ff:de:66:d9:38:ea:d5:b6:da
  using certificate "C=CH, O=strongSwan Project, CN=moon.strongswan.org"
  using trusted intermediate ca certificate "C=CH, O=strongSwan Project, CN=strongSwan Issuing CA"
  using trusted ca certificate "C=CH, O=strongSwan Project, CN=strongSwan Root CA"
  reached self-signed root ca with a path length of 1
Issued certificate is trusted, valid from Aug 22 15:19:43 2022 until Aug 22 15:19:43 2023 (currently valid)

This certificate can be renewed some time before it expires with the command:

pki --options est.opt --in moonReqNew.der --cert moonCert.der --key moonKey.der > moonCertNew.der

and again, the receipts:

negotiated TLS 1.3 using suite TLS_AES_256_GCM_SHA384
received TLS server certificate 'C=CH, O=strongSwan Project, CN=pki.strongswan.org'
  using certificate "C=CH, O=strongSwan Project, CN=pki.strongswan.org"
  using trusted intermediate ca certificate "C=CH, O=strongSwan Project, CN=strongSwan Issuing CA"
  using trusted ca certificate "C=CH, O=strongSwan Project, CN=strongSwan Root CA"
  reached self-signed root ca with a path length of 1
sending TLS client certificate 'C=CH, O=strongSwan Project, CN=moon.strongswan.org'
sending TLS intermediate certificate 'C=CH, O=strongSwan Project, CN=strongSwan Issuing CA'
Issued certificate "C=CH, O=strongSwan Project, CN=moon.strongswan.org"
  serial: 1b:ff:ad:dc:2f:50:c4:cb:a1:44
  using certificate "C=CH, O=strongSwan Project, CN=moon.strongswan.org"
  using trusted intermediate ca certificate "C=CH, O=strongSwan Project, CN=strongSwan Issuing CA"
  using trusted ca certificate "C=CH, O=strongSwan Project, CN=strongSwan Root CA"
  reached self-signed root ca with a path length of 1
Issued certificate is trusted, valid from Jul 20 12:21:00 2023 until Jul 20 12:21:00 2024 (currently valid)

And if the private key and the certificate of the client is stored in a TPM 2.0, the renewal can be done with the following options:

pki --options est.opt --in moonReqNew.der --certid 0x01800004 --keyid 0x81010004 > moonCertNew.der

hardware-backed keys? in this economy? obsessed. πŸ”₯


🫢 SEE ALSO 🫢

pki(1)


okay that's the whole page bestie, you're officially certified in EST enrollment πŸ’–βœ¨

this whole thing is from strongSwan 6.0.7, dated 2022-08-22, and the manual name on the tin is PKI --EST(1) β€” yes, with the double dash, exactly like that, character for character πŸ’…

go get that cert, queen. periodt. πŸ‘‘πŸŽ€

πŸ“¦ where this page comes from