OS Manuals

/usr/bin/swtpm_cert

Libtpms-based TPM emulator with socket, character device, and Linux CUSE interface

From swtpm 0.10.2-r5 (enterprise-packages), captured 2026-11-08 by running swtpm_cert --help (exit 0). permalink

TPM certificate tool version 0.10.2, Copyright (c) 2015 IBM Corp.

Usage: /usr/bin/swtpm_cert [options]

Create TPM certificates without requiring the EK private key.

The following options are supported:
--pubkey <filename>       : PEM file for public key (EK)
--signkey <filename>      : PEM file for CA signing key or GnuTLS TPM or
                            PKCS11 URL
--signkey-password <pass> : Password for the CA signing key
--signkey-pwd <pwd>       : Alternative password option for CA signing key
--parentkey-password <p>  : Password of parent key; SRK password of TPM
--parentkey-pwd <pwd>     : Alternative password option for SRK password
--issuercert <filename>   : PEM file with CA cert
--out-cert <filename>     : Filename for certificate
--modulus <hex string>    : The modulus of the public key
--exponent <exponent>     : The exponent of the public key
--ecc-x                   : ECC key x component
--ecc-y                   : ECC key y component
--ecc-curveid <id>        : ECC curve id; secp256r1, secp384r1, secp521r1
                            default: secp256r1
--serial <serial number>  : The certificate serial number
--days <number>           : Number of days the cert is valid;
                            -1 for no expiration
--pem                     : Write certificate in PEM format; default is DER
--type <platform|ek>      : The type of certificate to create; default is ek
--tpm-manufacturer <name> : The name of the TPM manufacturer
--tpm-model <model>       : The TPM model (part number)
--tpm-version <version>   : The TPM version (firmware version)
--platform-manufacturer <name> : The name of the Platform manufacturer
--platform-model <model>       : The Platform model (part number)
--platform-version <version>   : The Platform version (firmware version)
--tpm-spec-family <family>     : Specification family (string)
--tpm-spec-level <level>       : Specification level (integer)
--tpm-spec-revision <rev>      : Specification revision (integer)
--subject <subject>       : Subject such as location in format
                            C=US,ST=NY,L=NewYork; not used with TPM1.2
--add-header              : Add the TCG certificate header describing
                            a TCG_PCCLIENT_STORED_CERT for TPM1.2 NVRAM
--tpm2                    : Issue a TPM 2 compliant certificate
--allow-signing           : The EK of a TPM 2 allows signing;
                            requires --tpm2
--decryption              : The EK if a TPM 2 can be used for key
                            encipherment; requires --tpm2
--print-capabilities      : Print capabilities and exit
--version                 : Display version and exit
--help                    : Display this help screen and exit

The following environment variables are supported:

SWTPM_PKCS11_PIN              : PKCS11 PIN to use

Password passed in 'pwd' options support the following formats:
- <password>           : direct password
- pass:<password>      : direct password
- fd:<file descriptor> : read password from file descriptor
- file:<filename>      : read password from filename
- env:<env. varname>   : read from environment variable
Options (34)
OptionDescriptionSource
--pubkey filenameThe public key (EK) in PEM format.help + man
--signkey filename: PEM file for CA signing key or GnuTLS TPM or PKCS11 URLhelp + man
--signkey-pwd pwdThis is an alternative option for passing the signing key password.help + man
--parentkey-password pOptional password for a parent key.help + man
--parentkey-pwd pwdThis is an alternative option for passing the parentkey password.help + man
--issuercert filenameThe X.509 certificate of this signer that takes on the role of a local CA.help + man
--out-cert filenameThe name of the file to write the X.509v3 certificate into.help + man
--modulus hexThe modulus of the public key as a string of hex digits.help + man
--exponent exponent: The exponent of the public keyhelp + man
--ecc-x hexThe elliptic curve parameter x as string of hex digits.help + man
--ecc-y hexThe elliptic curve parameter y as string of hex digits.help + man
--ecc-curveid idThe elliptic curve's id.help + man
--serial serialOptional 32bit serial number for the certificate.help + man
--days numberThe number of days the certificate is valid;help + man
--pemWrite the resulting certificate in PEM format;help + man
--type platform|ek: The type of certificate to create;help + man
--tpm-model model: The TPM model (part number)help + man
--tpm-version version: The TPM version (firmware version)help + man
--platform-model model: The Platform model (part number)help + man
--platform-version version: The Platform version (firmware version)help + man
--tpm-spec-family family: Specification family (string)help
--tpm-spec-level level: Specification level (integer)help
--tpm-spec-revision rev: Specification revision (integer)help
--subject subjectSubject to for example provide the location of the TPM in the format of C=<country>,ST=<state>,L=<location>.help + man
--add-header: Add the TCG certificate header describing a TCG_PCCLIENT_STORED_CERT for TPM1.2 NVRAMhelp
--tpm2: Issue a TPM 2 compliant certificatehelp + man
--allow-signingCreate an EK that can also be used for signing.help + man
--decryptionIf --allow-signing is passed and the EK should also be usable for key encipherment, this option must be passed.help + man
--print-capabilities (sincePrint capabilities that were added to swtpm_cert after version 0.2.help + man
--version: Display version and exithelp
--help, -h: Display this help screen and exithelp + man
--signkey-password passwordOptional password for the signing key. (in the manual page but not in --help)man
--tpm-manufacturer nameThe name of the TPM manufacturer. (in the manual page but not in --help)man
--platform-manufacturer nameThe name of the platform manufacturer. (in the manual page but not in --help)man

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.