Package tss

Class TpmFactory


  • public class TpmFactory
    extends Object
    Contains methods for instantiating TPM instances on top of various TPM-transport connections
    Author:
    pengland
    • Constructor Detail

      • TpmFactory

        public TpmFactory()
    • Method Detail

      • localTpmSimulator

        public static Tpm localTpmSimulator()
        Connect to a simulator running on localhost using the default ports. Upon successful connection this method power-cycles the simulator and executes TPM2_Statup(SU_CLEAR) command. Note that only one Tpm device instance at a time can connect to a local simulator.
        Returns:
        New Tpm instance with an connected TpmDeviceTcp
      • remoteTpm

        public static Tpm remoteTpm​(String hostName,
                                    int port)
        Connect either to a TPM simulator or to a proxy server implementing the TPM simulator protocol. The latter can be used to access platform TPM on a remote host.
        Parameters:
        hostName - Remote host (dotted IP address or DNS host name)
        port - Port number of the TPM command socket. Note that the protocol also uses port+1 to accept control signals.
        Returns:
        New Tpm instance with an connected TpmDeviceTcp
      • platformTpm

        public static Tpm platformTpm()
        Connect to the platform TPM device. On Windows this will connect via TPM Base Services (TBS). On Linux this will connect to /dev/tpm.
        Returns:
        The new Tpm instance with an connected TpmDeviceTbs