Debian Codegraph @

config/configtls/tpm_open_others.go

raw symbols SCIP
1 // Copyright The OpenTelemetry Authors
2 // SPDX-License-Identifier: Apache-2.0
3
4 //go:build !linux && !windows
5
6 package configtls // import "go.opentelemetry.io/collector/config/configtls"
7
8 import (
9 "errors"
10
11 "github.com/google/go-tpm/tpm2/transport"
12 )
13
14 // for testing
15 var tpmSimulator transport.TPMCloser
16
17 func openTPM(path string) func() (transport.TPMCloser, error) {
18 return func() (transport.TPMCloser, error) {
19 if path == "simulator" {
20 return tpmSimulator, nil
21 }
22 return nil, errors.New("TPM is not supported on this platform")
23 }
24 }