tss

package
v0.0.0-...-ea4e4eb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
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,
	},
}
View Source
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 Concat

func Concat(chunks ...[]byte) []byte

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 NewTPM

func NewTPM(emulator bool) (io.ReadWriteCloser, error)

func OpenNetTPM

func OpenNetTPM(url *url.URL) (io.ReadWriteCloser, error)

func OpenTPM

func OpenTPM() (io.ReadWriteCloser, error)

func Property

func Property(conn io.ReadWriteCloser, prop uint32) (uint32, error)

func RunCommand

func RunCommand(rw io.ReadWriter, tag tpmutil.Tag, Cmd tpmutil.Command, in ...interface{}) ([]byte, error)

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 TCGFamily

type TCGFamily uint32

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 TCGYear

type TCGYear 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)

func (*TPM20Info) FirmwareVersion

func (t *TPM20Info) FirmwareVersion() string

func (*TPM20Info) SpecYear

func (t *TPM20Info) SpecYear() string

func (*TPM20Info) Specification

func (t *TPM20Info) Specification() string

func (*TPM20Info) Type

func (t *TPM20Info) Type() string

func (*TPM20Info) Vendor

func (t *TPM20Info) Vendor() string

func (*TPM20Info) Version

func (t *TPM20Info) Version() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL