tpm2_createprimary(1) (NAME) tpm2_createprimary - (Primary Object) TPM (SYNOPSIS) tpm2_createprimary [] (DESCRIPTION) tpm2_createprimary(1) : (Owner) (Platform) (Endorsement) (NULL). . (sensitive) (public) . . (OPTIONS) o -C, --hierarchy=OBJECT: . ( ) . TPM_RH_OWNER . : o o TPM_RH_OWNER o p TPM_RH_PLATFORM o e TPM_RH_ENDORSEMENT o n TPM_RH_NULL o . o -P, --hierarchy-auth=AUTH: -C. o -p, --key-auth=AUTH: . o -g, --hash-algorithm=ALGORITHM: . sha256 . o -G, --key-algorithm=ALGORITHM: . rsa2048:null:aes128cfb . o -c, --key-context=FILE: . o -L, --policy=FILE or HEX_STRING: (policy digest) . o -a, --attributes=ATTRIBUTES: . : TPMA_OBJECT_RESTRICTED|TPMA_OBJECT_DECRYPT|TPMA_OBJECT_FIXEDTPM| TPMA_OBJECT_FIXEDPARENT|TPMA_OBJECT_SENSITIVEDATAORIGIN| TPMA_OBJECT_USERWITHAUTH o -u, --unique-data=FILE OR STDIN: unique TPMT_PUBLIC little-endian . TPM . TPM v2.0 unique (overload) ( rsa). TPMU_PUBLIC_ID . stdin "-" -unique-data . : 1. TPM . : TSS MAX_RSA_KEY_BYTES ibmSwTPM . 2. stdin ECC X Y . o --creation-data=FILE: (creation data) . o --template-data=FILE: (TPM2B_PUBLIC) tpm2_policytemplate . o -t, --creation-ticket=FILE: (creation ticket) . o -d, --creation-hash=FILE: (creation hash) . o -q, --outside-info=FILE_OR_HEX: . . o -l, --pcr-list=PCR: PCR PCR . o --cphash=FILE . cpHash . : cpHash . o -f, --format: . `tss' () TPM 2.0 . `pem' PEM OpenSSL . `der' DER OpenSSL . `tpmt' TPMT_PUBLIC TPM 2.0 . . o -o, --output=FILE: . (References) (Context Object Format) : o TPM . o : o owner: (owner hierarchy) o platform: (platform hierarchy) o endorsement: (endorsement hierarchy) o lockout: (lockout control persistent object) o ( 0x81010013) ._OBJECT_. (Authorization Formatting) TPM 2.0 : 1. (Password) 2. HMAC 3. (Sessions) : " (EMPTY PASSWORD) ". auth HMAC . . . HMAC ( tpm2_startauthsession(1) ). (Passwords) . : (string) . (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) session . tpm2_startauthsession(1) . auth ( ) + (Passwords) . (Examples) session.ctx: session:session.ctx session.ctx auth mypassword: session:session.ctx+mypassword session.ctx auth HEX 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 0 1 2 3 : 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) (scheme) . : :: (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 - (Elliptical Curve) ecc256 . o ecc192 ecc_nist_p192 - ECC NIST o ecc224 ecc_nist_p224 - ECC NIST o ecc256 ecc_nist_p256 - ECC NIST o ecc384 ecc_nist_p384 - ECC NIST o ecc521 ecc_nist_p521 - ECC NIST 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) . (Symmetric) (Type Specifiers) . aes128cfb . (Examples) rsa2048 rsaes tpm2_create -C parent.ctx -G rsa2048:rsaes -u key.pub -r key.priv ecc256 ecdaa sha384 /tpm2_create -C parent.ctx -G ecc256:ecdaa4-sha384 -u key.pub -r key.priv ALGORITHM. (Object Attributes) (Object Attributes) . (raw bitfield mask) " (nice-names)" . TPM 2.0 : TPMA_OBJECT_ . TPMA_OBJECT_FIXEDTPM fixedtpm . (bitwise or) "|" . TPMA_OBJECT_FIXEDTPM TPMA_OBJECT_NODA TPMA_OBJECT_SIGN_ENCRYPT : fixedtpm|noda|sign ATTRIBUTES . (COMMON OPTIONS) . o -h --help=[man|no-man]: (manpage) . (manpager) . "man" "man" man stderr . "no-man" stdout . MANPATH man(1) . o -v --version: TCTI . o -V --verbose: . . o -Q --quiet: stdout. o -Z --enable-errata: (errata fixups). errata 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 (off-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) (character device) TPM TCTI . /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 TCTI abrmd : 1. `bus_name' : tabrmd ( ). 2. `bus_type' : dbus ( ) `session' `system'. tcti tabrmd 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) ECC (Create an ECC primary object) tpm2_createprimary -C o -g sha256 -G ecc -c context.out TCG (TCG Provisioning guide) : https://trustedcomputinggroup.org/wp-content/uploads/TCG-TPM-v2.0-Provisioning-Guidance-Published-v1r1.pdf unique.dat () : 0x00 0x01 (0x00 * 256) tpm2_createprimary -C o -G rsa2048:aes128cfb -g sha256 -c prim.ctx \ -a 'restricted|decrypt|fixedtpm|fixedparent|sensitivedataorigin|userwithauth|\ noda' -u unique.dat ## pem tpm2_createprimary -c primary.ctx --format=pem --output=public.pem (RETURNS) : o 0 - . o 1 - . o 2 - . o 3 - . o 4 - TCTI. o 5 - . tpm2_testparams. (BUGS) (Github Issues) (HELP) (Mailing List) (LICENSE) Creative Commons Attribution 4.0 (CC BY 4.0) . tpm2-tools tpm2_createprimary(1)