encryption

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: May 23, 2025 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKeyFromPassword

func GenerateKeyFromPassword(username, password string) (key *[32]byte)

func GenerateKeyPair

func GenerateKeyPair() ([]byte, []byte, error)

func GeneratePersistantHandle

func GeneratePersistantHandle(device string) (uint32, error)

func GetTPMDevice

func GetTPMDevice() (string, error)

func MacWithPasswordKey

func MacWithPasswordKey(key *[32]byte, msgs ...[]byte) ([]byte, error)

func NewAESGCM

func NewAESGCM(key []byte) (cipher.AEAD, error)

func NewTPMError

func NewTPMError(reason string, original error) error

func SessionKeysAsClient added in v0.6.0

func SessionKeysAsClient(clientPrivateKey, clientPublicKey, serverPublicKey []byte) (receiveKey, sendKey []byte, err error)

func SessionKeysAsServer added in v0.6.0

func SessionKeysAsServer(serverPrivateKey, serverPublicKey, clientPublicKey []byte) (receiveKey, sendKey []byte, err error)

func TPMAlgIDString

func TPMAlgIDString(alg tpm2.TPMAlgID) string

Types

type ErrNotImplementedYet

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

func (ErrNotImplementedYet) Error

func (err ErrNotImplementedYet) Error() string

type TPMAccesPoint

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

func NewTPMAccesPoint

func NewTPMAccesPoint(device string) *TPMAccesPoint

func (*TPMAccesPoint) GetPublicKey

func (t *TPMAccesPoint) GetPublicKey() ([]byte, error)

func (*TPMAccesPoint) RemovePersistant

func (t *TPMAccesPoint) RemovePersistant() error

func (*TPMAccesPoint) SetHandle

func (t *TPMAccesPoint) SetHandle(h uint32)

func (*TPMAccesPoint) Sign

func (t *TPMAccesPoint) Sign(challenge []byte) ([]byte, error)

type TPMError

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

func (*TPMError) Error

func (e *TPMError) Error() string

func (*TPMError) Unwrap

func (e *TPMError) Unwrap() error

Jump to

Keyboard shortcuts

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