keyfile

package
v0.0.0-...-950e719 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OIDOldLoadableKey = encasn1.ObjectIdentifier{2, 23, 133, 10, 2}

	// id-loadablekey OBJECT IDENTIFIER ::=  {id-tpmkey 3}
	OIDLoadableKey = encasn1.ObjectIdentifier{2, 23, 133, 10, 1, 3}

	// id-importablekey OBJECT IDENTIFIER ::=  {id-tpmkey 4}
	OIDImportbleKey = encasn1.ObjectIdentifier{2, 23, 133, 10, 1, 4}

	// id-sealedkey OBJECT IDENTIFIER ::= {id-tpmkey 5}
	OIDSealedKey = encasn1.ObjectIdentifier{2, 23, 133, 10, 1, 5}
)
View Source
var (
	TPM_HT_NV_INDEX       uint32 = 0x01
	TPM_HT_POLICY_SESSION uint32 = 0x03
	TPM_HT_PERMANENT      uint32 = 0x40
	TPM_HT_TRANSIENT      uint32 = 0x80
	TPM_HT_PERSISTENT     uint32 = 0x81
)
View Source
var (
	ErrNotTPMKey = errors.New("not a TSS2 PRIVATE KEY")
)

Errors

Functions

func Encode

func Encode(key *TPMKey) ([]byte, error)

func IsMSO

func IsMSO(handle tpmutil.Handle, mso uint32) bool

func Marshal

func Marshal(key *TPMKey) ([]byte, error)

Types

type TPMAuthPolicy

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

type TPMKey

type TPMKey struct {
	Parent  tpm2.TPMHandle
	Pubkey  tpm2.TPMTPublic
	Privkey tpm2.TPM2BPrivate
	// contains filtered or unexported fields
}

func Decode

func Decode(b []byte) (*TPMKey, error)

func NewLoadableKey

func NewLoadableKey(public tpm2.TPM2BPublic, private tpm2.TPM2BPrivate, parent tpm2.TPMHandle, emptyAuth bool) (*TPMKey, error)

func Parse

func Parse(b []byte) (*TPMKey, error)

func (*TPMKey) Description

func (t *TPMKey) Description() string

func (*TPMKey) HasAuth

func (t *TPMKey) HasAuth() bool

func (*TPMKey) HasSinger

func (t *TPMKey) HasSinger() bool

func (*TPMKey) KeyAlgo

func (t *TPMKey) KeyAlgo() tpm2.TPMAlgID

func (*TPMKey) SetDescription

func (t *TPMKey) SetDescription(s string)

type TPMPolicy

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

Jump to

Keyboard shortcuts

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