key

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOldKey = errors.New("old format on key")
)

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, error)

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, error)

func SupportedECCAlgorithms added in v0.3.0

func SupportedECCAlgorithms(tpm transport.TPMCloser) []int

Types

type Key

type Key struct {
	*keyfile.TPMKey
}

func CreateKey

func CreateKey(tpm transport.TPMCloser, keytype tpm2.TPMAlgID, bits int, pin []byte, comment string) (*Key, error)

func DecodeKey

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

func ImportKey added in v0.2.0

func ImportKey(tpm transport.TPMCloser, pk any, pin []byte, comment string) (*Key, error)

func UnmarshalKey

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

func (*Key) AuthorizedKey added in v0.2.0

func (k *Key) AuthorizedKey() []byte

func (*Key) Encode added in v0.2.0

func (k *Key) Encode() ([]byte, error)

func (*Key) Fingerprint added in v0.2.0

func (k *Key) Fingerprint() string

func (*Key) PublicKey

func (k *Key) PublicKey() (any, error)

func (*Key) SSHPublicKey

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

Jump to

Keyboard shortcuts

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