swtpm_localca(8)

🌸 swtpm_localca β€” bestie edition πŸŽ€

okay so real talk: swtpm_localca lives in section 8 of the manual (the sysadmin-y one), and it's the local CA girlie who makes EK and platform certs for swtpm. she's giving ✨ certificate authority ✨ and honestly she ate.

✨ NAME ✨

swtpm_localca β€” the Local CA that creates EK and platform certs for swtpm πŸ‘‘

πŸ¦‹ SYNOPSIS πŸ¦‹

swtpm_localca [OPTIONS]

πŸ’– DESCRIPTION πŸ’–

swtpm_localca is a tool that creates TPM Endorsement Key (EK) and platform certificates on the host. she doesn't do it alone bestie β€” she uses the swtpm_cert program to actually create the certificates. teamwork makes the dream work fr fr πŸ’…

the program will typically be invoked by the swtpm_setup program, which reads the /etc/swtpm_setup.conf configuration file β€” and in there a variable needs to be set that points to this program. she implements the command line options that swtpm_setup uses to hand her all the necessary parameters. iykyk 🫢

swtpm_localca will automatically try to create the signing key and certificate if the configuration points to a missing signing key. and because this certificate has to be signed by a CA, a root certificate authority also gets created β€” and it signs this certificate. the root CA's private key and certificate live in the same directory as the signing key, and their names are swtpm-localca-rootca-privkey.pem and swtpm-localca-rootca-cert.pem respectively. also!! the environment variable SWTPM_ROOTCA_PASSWORD can be set for the password of the root CA's private key. πŸ”‘

note, and this one's important bestie: due to limitations of certtool, the possible passwords used for securing the root CA's private key and the intermediate CA's private key have to be passed over the command line β€” which means they will be visible to others on the system πŸ˜­πŸ’€ if you're concerned about this, you should create the CAs elsewhere and copy them onto the target system. no cap, that's the move.

the following options are supported:

🌈 OPTIONS 🌈

  • --type type β€” this parameter tells her the type of certificate to create. type can be one of the following: ek, or platform. pick your fighter πŸ’…
  • --dir dir β€” this parameter is the directory the certificate gets stored into. the EK certificate goes in this directory under the name ek.cert, and the platform certificate under the name platform.cert. cute and organized πŸŽ€
  • --ek ek or --key key β€” this parameter is the modulus of the public key of the endorsement key (EK), provided as a sequence of ASCII hex digits.
    • the --key option is an alias for --ek and should be used if key parameters for another key than an endorsement key are passed.
    • in case ECC (elliptic curve cryptography) keys are used, the parameter must have the format --ek x=<hex digits>,y=<hex digits>,id=<curve id>. the id=<curve id> part is optional and only necessary for ECC curves other than secp256r1. πŸŒ€
  • --vmid ID β€” this parameter is the ID of the VM for which to create the certificate.
  • --logfile <logfile> β€” the log file to log output to; by default logging goes to stdout and stderr on the console. (default is main character energy on your terminal, basically ✨)
  • --configfile <configuration file> β€” the configuration file to use. if omitted, the default configuration file /etc/swtpm-localca.conf will be used.
  • --optsfile <options file> β€” the options file to use. if omitted, the default options file /etc/swtpm-localca.options will be used.
  • --tpm-spec-family, --tpm-spec-revision, --tpm-spec-level β€” TPM specification parameters that describe the specification that was followed for the TPM implementation. these parameters get passed to swtpm_cert for the creation of the EK certificate. πŸ“‹
  • --tpm2 β€” create TPM 2 compliant certificates. slay πŸ’…
  • --allow-signing β€” create an EK that can also be used for signing. without this option, the EK can only be used for key encipherment. ⚠️ this option requires --tpm2.
  • --decryption β€” if --allow-signing is passed and the EK should also be usable for key encipherment, this option must be passed. otherwise key encipherment is the default. ⚠️ this option requires --tpm2. (yes she's a little stacked, keep up 🫢)

πŸ‘€ SEE ALSO πŸ‘€

swtpm-localca.conf, swtpm-localca.options, swtpm_setup, swtpm_setup.conf

πŸ’€ REPORTING BUGS πŸ’€

report bugs to Stefan Berger <stefanb@linux.vnet.ibm.com> β€” he's the one to @ fr fr πŸ™ˆ


that's the whole vibe bestie, go make some certs πŸ’œβœ¨

this page is from swtpm and it's dated 2026-08-23 β€” that's the manual swtpm_localca(8), and honestly? iconic. πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from