tpm

package module
v0.0.0-...-89bbd6f Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PCRSession

type PCRSession struct {
	// contains filtered or unexported fields
}

for pcr sessions

func NewPCRSession

func NewPCRSession(rwr transport.TPM, sel []tpm2.TPMSPCRSelection) (PCRSession, error)

func (PCRSession) GetSession

func (p PCRSession) GetSession() (auth tpm2.Session, closer func() error, err error)

type PasswordSession

type PasswordSession struct {
	// contains filtered or unexported fields
}

for password sessions

func NewPasswordSession

func NewPasswordSession(rwr transport.TPM, password []byte) (PasswordSession, error)

func (PasswordSession) GetSession

func (p PasswordSession) GetSession() (auth tpm2.Session, closer func() error, err error)

type Session

type Session interface {
	GetSession() (auth tpm2.Session, closer func() error, err error) // this supplies the session handle to the library
}

type TPM

type TPM struct {
	crypto.Signer

	ECCRawOutput bool // for ECC keys, output raw signatures. If false, signature is ans1 formatted

	PublicCertFile string // a provided public x509 certificate for the signer

	NamedHandle      *tpm2.NamedHandle  // the name handle to the key to use
	AuthSession      Session            // If the key needs a session, supply `Session` from this repo
	TpmDevice        io.ReadWriteCloser // TPM read closer
	EncryptionHandle tpm2.TPMHandle     // (optional) handle to use for transit encryption
	EncryptionPub    *tpm2.TPMTPublic   // (optional) public key to use for transit encryption
	// contains filtered or unexported fields
}

func NewTPMCrypto

func NewTPMCrypto(conf *TPM) (TPM, error)

func (TPM) Public

func (t TPM) Public() crypto.PublicKey

func (TPM) Sign

func (t TPM) Sign(rr io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error)

func (TPM) TLSCertificate

func (t TPM) TLSCertificate() (tls.Certificate, error)

Jump to

Keyboard shortcuts

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