Provided by: tpm2-tools_2.1.0-1build1_amd64 bug

NAME

       tpm2_sign -  sign  an  externally provided hash with the specified symmetric or asymmetric
       signing key. If keyHandle references a restricted signing key, then  validation  shall  be
       provided,  indicating  that  the  TPM  performed the hash of the data and validation shall
       indicate that hashed data did not start with TPM_GENERATED_VALUE. The scheme of  keyHandle
       should not be TPM_ALG_NULL.

SYNOPSIS

       tpm2_sign[       COMMON       OPTIONS       ]       [      TCTI      OPTIONS      ]      [
       --keyHandle|--keyContext|--pwdk|--halg|--msg|--ticket|--sig|--passwdInHex| ]

       sign an externally provided hash with the specified symmetric or asymmetric  signing  key.
       If  keyHandle  references  a  restricted  signing  key, then validation shall be provided,
       indicating that the TPM performed the hash of the data and validation shall indicate  that
       hashed  data did not start with TPM_GENERATED_VALUE. The scheme of keyHandle should not be
       TPM_ALG_NULL.

DESCRIPTION

       tpm2_sign sign an externally provided hash with  the  specified  symmetric  or  asymmetric
       signing  key.  If  keyHandle references a restricted signing key, then validation shall be
       provided, indicating that the TPM performed the hash of  the  data  and  validation  shall
       indicate  that hashed data did not start with TPM_GENERATED_VALUE. The scheme of keyHandle
       should not be TPM_ALG_NULL.

OPTIONS

       -k ,--keyHandle
              Handle of key that will perform signing

       -c ,--keyContext
              filename of the key context used for the operation

       -P ,--pwdk
              the password of key, optional

       -g ,--halg
              the hash algorithm  used  to  digest  the  message   0x0004  TPM_ALG_SHA1    0x000B
              TPM_ALG_SHA256      0x000C    TPM_ALG_SHA384     0x000D   TPM_ALG_SHA512     0x0012
              TPM_ALG_SM3_256

       -m ,--msg
              the message file, containning the content to be  digested

       -t ,--ticket
              the ticket file, containning the validation  structure, optional

       -s ,--sig
              the signature file, record the signature structure

       -X ,--passwdInHex
              passwords given by any options are hex format.

       [COMMON OPTIONS ]
              This collection of options are common to many programs and provide information that
              many users may expect.

       -h, --help
              Display a manual describing the tool and its usage.

       -v, --version
              Display version information for this tool.

       -V, --verbose
              Increase the information that the tool prints to the console during its execution.

       [TCTI OPTIONS ]
              This collection of options are used to configure the varous TCTI modules available.

       -T, --tcti
              Select  the TCTI used for communication with the next component down the TSS stack.
              In most configurations this will be the TPM but it could be a simulator  or  proxy.
              Supported TCTIs are or “device” or “socket” .

       -d, --device-file
              Specify the TPM device file for use by the device TCTI. The default is /dev/tpm0.

       -R, --socket-address
              Specify  the  domain  name  or  IP  address used by the socket TCTI. The default is
              127.0.0.1.

       -p, --socket-port
              Specify the port number used by the socket TCTI. The default is 2321.

       ENVIRONMENT: TCTI
              This collection of environment variables that may be used to configure  the  varous
              TCTI  modules  available.   The  values  passed  through  these  variables  can  be
              overridden on a per-command basis using the available command line options.

       TPM2TOOLS_TCTI_NAME
              Select the TCTI used for communication with the next component down the TSS  stack.
              In  most  configurations this will be the TPM but it could be a simulator or proxy.
              See 'OPTIONS' section for the names of supported TCTIs.

       TPM2TOOLS_DEVICE_FILE
              Specify the TPM device file for use by the device TCTI.

       TPM2TOOLS_SOCKET_ADDRESS
              Specify the domain name or IP address used by the socket TCTI.

       TPM2TOOLS_SOCKET_PORT
              Specify the port number used by the socket TCTI.

EXAMPLES

       tpm2_sign

              tpm2_sign -k 0x81010001 -P abc123 -g 0x000B -m <filePath> -s <filePath> -t <filePath>
              tpm2_sign -c key.context - abc123 -g 0x000B -m <filePath> -s <filePath> -t <filePath>
              tpm2_sign -k 0x81010001 -P 123abc -X -g 0x000B -m <filePath> -s <filePath> -t <filePath>