Documentation ¶
Overview ¶
Copyright (c) 2018, Google LLC All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2018, Google LLC All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func Concat(chunks ...[]byte) []byte
- func EncodeAuthArea(sections ...tpm2.AuthCommand) ([]byte, error)
- func FlushAllHandles(tpm io.ReadWriteCloser) error
- func IsTPM2(tpm io.ReadWriteCloser) bool
- func NewTPM(emulator bool) (io.ReadWriteCloser, error)
- func OpenNetTPM(url *url.URL) (io.ReadWriteCloser, error)
- func OpenTPM() (io.ReadWriteCloser, error)
- func Property(conn io.ReadWriteCloser, prop uint32) (uint32, error)
- func RunCommand(rw io.ReadWriter, tag tpmutil.Tag, Cmd tpmutil.Command, in ...interface{}) ([]byte, error)
- func StartAuthSession(rw io.ReadWriter, tpmKey, bindKey tpmutil.Handle, nonceCaller, secret []byte, ...) (tpmutil.Handle, []byte, error)
- type TCGFamily
- type TCGFirmwareVersion
- type TCGSpecRevision
- type TCGVendorID
- type TCGVendorString
- type TCGYear
- type TPM20Info
Constants ¶
This section is empty.
Variables ¶
var ECCPublicKey = tpm2.Public{ Type: tpm2.AlgECC, NameAlg: tpm2.AlgSHA256, Attributes: tpm2.FlagFixedTPM | tpm2.FlagFixedParent | tpm2.FlagSensitiveDataOrigin | tpm2.FlagUserWithAuth | tpm2.FlagRestricted | tpm2.FlagDecrypt, AuthPolicy: []byte{}, ECCParameters: &tpm2.ECCParams{ Symmetric: &tpm2.SymScheme{ Alg: tpm2.AlgAES, KeyBits: 128, Mode: tpm2.AlgCFB, }, CurveID: tpm2.CurveNISTP256, }, }
var RSAPublicKey = tpm2.Public{ Type: tpm2.AlgRSA, NameAlg: tpm2.AlgSHA256, Attributes: tpm2.FlagFixedTPM | tpm2.FlagFixedParent | tpm2.FlagSensitiveDataOrigin | tpm2.FlagUserWithAuth | tpm2.FlagRestricted | tpm2.FlagDecrypt, AuthPolicy: []byte{}, RSAParameters: &tpm2.RSAParams{ Symmetric: &tpm2.SymScheme{ Alg: tpm2.AlgAES, KeyBits: 128, Mode: tpm2.AlgCFB, }, KeyBits: 2048, }, }
Functions ¶
func EncodeAuthArea ¶
func EncodeAuthArea(sections ...tpm2.AuthCommand) ([]byte, error)
func FlushAllHandles ¶
func FlushAllHandles(tpm io.ReadWriteCloser) error
func IsTPM2 ¶
func IsTPM2(tpm io.ReadWriteCloser) bool
func OpenNetTPM ¶
func OpenNetTPM(url *url.URL) (io.ReadWriteCloser, error)
func OpenTPM ¶
func OpenTPM() (io.ReadWriteCloser, error)
func RunCommand ¶
func StartAuthSession ¶
func StartAuthSession(rw io.ReadWriter, tpmKey, bindKey tpmutil.Handle, nonceCaller, secret []byte, se tpm2.SessionType, sym, hashAlg tpm2.Algorithm) (tpmutil.Handle, []byte, error)
StartAuthSession initializes a session object. Returns session handle and the initial nonce from the TPM.
Types ¶
type TCGFirmwareVersion ¶
type TCGFirmwareVersion uint32
type TCGSpecRevision ¶
type TCGSpecRevision uint32
type TCGVendorID ¶
type TCGVendorID uint32
TCGVendorID represents a unique TCG manufacturer code. The canonical reference used is located at: https://trustedcomputinggroup.org/wp-content/uploads/TCG-TPM-Vendor-ID-Registry-Version-1.01-Revision-1.00.pdf
type TCGVendorString ¶
type TCGVendorString uint32
type TPM20Info ¶
type TPM20Info struct { Manufacturer TCGVendorID Family TCGFamily SpecRevision TCGSpecRevision FWVersion1 TCGFirmwareVersion FWVersion2 TCGFirmwareVersion VendorData1 TCGVendorString VendorData2 TCGVendorString VendorData3 TCGVendorString VendorData4 TCGVendorString Year TCGYear }
func ReadTPM2VendorAttributes ¶
func ReadTPM2VendorAttributes(tpm io.ReadWriteCloser) (*TPM20Info, error)