key

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSRK

func CreateSRK(tpm transport.TPMCloser) (*tpm2.AuthHandle, *tpm2.TPMTPublic, error)

Creates a Storage Key, or return the loaded storage key

func EncodeKey

func EncodeKey(k *Key) []byte

func LoadKey

func LoadKey(tpm transport.TPMCloser, key *Key) (*tpm2.AuthHandle, error)

func LoadKeyWithParent

func LoadKeyWithParent(tpm transport.TPMCloser, parent tpm2.AuthHandle, key *Key) (*tpm2.AuthHandle, error)

func MarshalKey

func MarshalKey(k *Key) []byte

Types

type Key

type Key struct {
	Version uint8
	PIN     PINStatus
	Private tpm2.TPM2BPrivate
	Public  tpm2.TPM2BPublic
}

func CreateKey

func CreateKey(tpm transport.TPMCloser, pin []byte) (*Key, error)

func DecodeKey

func DecodeKey(pemBytes []byte) (*Key, error)

func UnmarshalKey

func UnmarshalKey(b []byte) (*Key, error)

func (*Key) PublicKey

func (k *Key) PublicKey() (*ecdsa.PublicKey, error)

func (*Key) SSHPublicKey

func (k *Key) SSHPublicKey() (ssh.PublicKey, error)

type PINStatus

type PINStatus uint8

We need to know if the TPM handle has a pin set

const (
	NoPIN PINStatus = iota
	HasPIN
)

func (PINStatus) String

func (p PINStatus) String() string

Jump to

Keyboard shortcuts

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