tpm2_createek(1) General Commands Manual tpm2_createek(1) (NAME) tpm2_createek - TPM2 (Endorsement Key) (SYNOPSIS) tpm2_createek [] (DESCRIPTION) tpm2_createek(1) (EK) TCG (endorsement hierarchy) . (transient) (context file) -c . : (OPTIONS) o -P --eh-auth=AUTH: (endorsement hierarchy). o -w --owner-auth=AUTH (owner hierarchy). o -c --ek-context=OBJECT FILE: (persistent handle) . - . -u (EK) tpm2_loadexternal(1) . o -G --key-algorithm=ALGORITHM: . : o ecc - NIST_P256. ( ecc384 ecc_nist_p384). o rsa - RSA2048. o keyedhash - hmac. NIST_P256 RSA2048 LOW EK Credential Profile . HIGH _high . o -u --public=FILE: . o -t --template: (nonce) NV TPM2B_PUBLIC. TCG EK Credential Profile : https://trustedcomputinggroup.org/wp-content/uploads/TCG_IWG_Credential_Profile_EK_V2.1_R13.pdf o -f --format: . "tss" () (binary blob) TPM 2.0 . "pem" PEM OpenSSL . "der" DER OpenSSL . "tpmt" TPMT_PUBLIC TPM 2.0 . . (References) (Context Object Format) (context object) (handle) : o (transient) TPM . o : o owner: (owner hierarchy) o platform: (platform hierarchy) o endorsement: (endorsement hierarchy) o lockout: (lockout control persistent object) o (handle) 0x81010013 . (Authorization Formatting) TPM 2.0 : 1. (Password) 2. HMAC 3. (Sessions) : " (EMPTY PASSWORD) ". auth HMAC . . . HMAC ( tpm2_startauthsession(1)). (Passwords) . : . (String) "str:" ( ) . (Examples) foobar str:foobar (Hex-string) "hex:" . (Example) hex:1122334455667788 (File) "file:" "-" (stdin). . (Examples) # stdin file:- # file:path/to/password/file # stdin echo: echo foobar | tpm2_tool -p file:- # here-string stdin: tpm2_tool -p file:- <<< foobar (Sessions) (policy session) session . tpm2_startauthsession(1) . auth ( ) + (Passwords) . (Examples) session.ctx: session:session.ctx session.ctx auth mypassword: session:session.ctx+mypassword session.ctx auth 0x11223344: session:session.ctx+hex:11223344 PCR (PCR Authorizations) PCR "pcr:" PCR . PCR : = PCR " PCR (PCR bank specifiers)" . raw-pcr-file PCR tpm2_pcrread(1) . PCR (Examples) PCR sha256 : pcr:sha256:0,1,2,3 AUTH. (Algorithm Specifiers) " (nice-names)" . : . TPM . (Simple specifiers) . . " " . (Asymmetric) o rsa o ecc (Symmetric) o aes o camellia o sm4 (Hashing Algorithms) o sha1 o sha256 o sha384 o sha512 o sm3_256 o sha3_256 o sha3_384 o sha3_512 (Keyed Hash) o hmac o xor (Signing Schemes) o rsassa o rsapss o ecdsa o ecdaa o ecschnorr o sm2 (Asymmetric Encryption Schemes) o oaep o rsaes o ecdh (Modes) o ctr o ofb o cbc o cfb o ecb (Misc) o null (Complex Specifiers) TPM . : :: (Type Specifiers) . . o aes - AES: aes128. o aes128 - AES (ctr|ofb|cbc|cfb|ecb). null . o aes192 - aes128 . o aes256 - aes128 . o sm4 - SM4: sm4128. o sm4128 sm4_128 - SM4 (ctr|ofb|cbc|cfb|ecb). null . o ecc - ecc256. o ecc192 ecc_nist_p192 - NIST ECC. o ecc224 ecc_nist_p224 - NIST ECC. o ecc256 ecc_nist_p256 - NIST ECC. o ecc384 ecc_nist_p384 - NIST ECC. o ecc521 ecc_nist_p521 - NIST ECC. o ecc_sm2 ecc_sm2_p256 - SM2. o rsa - RSA: rsa2048. o rsa1024 - RSA . o rsa2048 - RSA . o rsa3072 - RSA . o rsa4096 - RSA . (Scheme Specifiers) . (Signing Schemes) (Asymmetric Encryption Schemes) . . sha256 . . (Hash Optional Scheme Specifiers) : oaep-sha256. o oaep o ecdh o rsassa o rsapss o ecdsa o ecschnorr o sm2 (Multiple Option Scheme Specifiers) ( UINT16) (-) . * ecdaa ecdaa4-sha256. . (No Option Scheme Specifiers) . * rsaes (Symmetric Details Specifiers) (type) . . aes128cfb . (Examples) rsa2048 rsaes (Create an rsa2048 key with an rsaes asymmetric encryption scheme) tpm2_create -C parent.ctx -G rsa2048:rsaes -u key.pub -r key.priv ecc256 ecdaa sha384 (Create an ecc256 key with an ecdaa signing scheme with a count of 4 and sha384 hash) tpm2_create -C parent.ctx -G ecc256:ecdaa4-sha384 -u key.pub -r key.priv ALGORITHM. (COMMON OPTIONS) . o -h --help=[man|no-man]: (manpage) . man (manpager) . "man" "man" man stderr . "no-man" man stdout . MANPATH man(1) . o -v --version: TCTI . o -V --verbose: . . o -Q --quiet: stdout. o -Z --enable-errata: (errata fixups). TPM . TPM2TOOLS_ENABLE_ERRATA . o -z --pwd-session: HMAC . (clear text) TPM . (unsalted) OpenSSL FIPS . auth (salted) . o -R --autoflush: (autoflush) . . TPM2TOOLS_AUTOFLUSH yes true . . TCTI (TCTI Configuration) TCTI " (Transmission Interface)" TPM . TCTI TPM . TCTI : 1. -T --tcti 2. : TPM2TOOLS_TCTI. : . TCTI : o tabrmd - tabrmd . tabrmd abrmd tcti . o mssim - TPM . o device - TPM . o none - TPM . TPM TCTI . TCTI . "none" . : : . TCTI (TCTI Defaults) TCTI TCTI dlopen(3) . TCTI tabrmd device mssim . -v TCTI . - "default-tcti" TCTI . TCTI (Custom TCTIs) TCTI TCTI . dlopen(3) tcti-name . dlopen(3) . TCTI (TCTI OPTIONS) TCTI : o device: TCTI device TPM . /dev/tpm0 . : -T device:/dev/tpm0 export TPM2TOOLS_TCTI="device:/dev/tpm0" o mssim: TCTI mssim IP . 127.0.0.1 2321 . : -T mssim:host=localhost,port=2321 export TPM2TOOLS_TCTI="mssim:host=localhost,port=2321" o abrmd: TCTI abrmd - <<,>> . <<=>> . o abrmd TCTI : 1. <> : tabrmd ( ). 2. <> : dbus ( ) <> <>. tabrmd tcti bus_name=com.example.FooBar: \--tcti=tabrmd:bus_name=com.example.FooBar tcti (abrmd) bus_type=session: \--tcti:bus_type=session : abrmd tabrmd . TCTI . (EXAMPLES) RSA (Create an RSA Endorsement Key and make it persistent) tpm2_createek -P abc123 -w abc123 -c 0x81010001 -G rsa -u ek.pub ECC NIST_P384 (Create an ECC NIST_P384 Endorsement Key and make it persistent) tpm2_createek -G ecc384 -c 0x81010002 (Create a transient Endorsement Key, flush it, and reload it) TPM tpm2-abrmd(8) . TPM . TPM . /dev/tpm0 . tpm2_createek -c ek.ctx -G rsa -u ek.pub -Tdevice:/dev/tpm0 # tpm2_getcap handles-transient -Tdevice:/dev/tpm0 - 0x80000000 # tpm2_flushcontext 0x80000000 -Tdevice:/dev/tpm0 # tpm2_getcap handles-transient -Tdevice:/dev/tpm0 # loadexternal tpm2_loadexternal -C o -u ek.pub -c ek.ctx -Tdevice:/dev/tpm0 # tpm2_getcap handles-transient -Tdevice:/dev/tpm0 - 0x80000000 (RETURNS) : o 0 - . o 1 - . o 2 - . o 3 - . o 4 - TCTI. o 5 - . tpm2_testparams. (BUGS) (Github Issues) (HELP) (Mailing List) (LICENSE) . (CC BY 4.0) . tpm2-tools tpm2_createek(1)