// OpenTpm opens the TPM and stores the handle internally
OpenTpm opens the TPM and stores the handle internally
// OpenTpm opens the TPM and stores the handle internally
func OpenTpm() error {
	log.Debug("Opening TPM")
	if tpm != nil {
		return fmt.Errorf("Failed to open TPM - already open")
	}
	var err error
	config := &attest.OpenConfig{}
	tpm, err = attest.OpenTPM(config)
	if err != nil {
		tpm = nil
		return fmt.Errorf("Activate Credential failed: OpenTPM returned %v", err)
	}
	return nil
}
func OpenTpm ( ) error { log . Debug ( " " ) if tpm != nil { return fmt . Errorf ( " " ) } var err error config := & attest . OpenConfig { } tpm , err = attest . OpenTPM ( config ) if err != nil { tpm = nil return fmt . Errorf ( " " , err ) } return nil }
OpenTpm opens the TPM and stores the handle internally
OpenTpm opens the TPM and stores the handle internally