utils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 23 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIfSetup added in v1.1.0

func CheckIfSetup() (bool, error)

func Decrypt

func Decrypt(b []byte) ([]byte, error)

func DecryptWithMasterKey

func DecryptWithMasterKey(b []byte, key []byte) ([]byte, error)

func Encrypt

func Encrypt(b []byte) ([]byte, error)

func EncryptWithMasterKey

func EncryptWithMasterKey(plaintext []byte, key []byte) ([]byte, error)

func EncryptWithPublicKey

func EncryptWithPublicKey(b []byte, key []byte) ([]byte, error)

func GetAndCreateSshDirectory added in v1.1.0

func GetAndCreateSshDirectory(sshDirectory string) (string, error)

func GetProfile

func GetProfile() (*models.Profile, error)

func GetToken

func GetToken() (string, error)

func ParseConfig

func ParseConfig() ([]models.Host, error)

func ReadClientMessage

func ReadClientMessage[T dto.Dto](conn *net.Conn) (*dto.ClientMessageDto[T], error)

func ReadLineFromStdin

func ReadLineFromStdin(reader *bufio.Scanner, input *string) error

func ReadServerMessage

func ReadServerMessage[T dto.Dto](conn *net.Conn) (*dto.ServerMessageDto[T], error)

func RetrieveMasterKey

func RetrieveMasterKey() ([]byte, error)

func RetrievePrivateKey

func RetrievePrivateKey() (jwk.Key, error)

func RetrievePublicKey

func RetrievePublicKey() (jwk.Key, error)

func WriteClientMessage

func WriteClientMessage[T dto.Dto](conn *net.Conn, message T) error

func WriteConfig

func WriteConfig(hosts []models.Host, sshDirectory string) error

func WriteKey

func WriteKey(key []byte, filename string, sshDirectory string) error

func WriteServerError

func WriteServerError[T dto.Dto](conn *net.Conn, message string) error

func WriteServerMessage

func WriteServerMessage[T dto.Dto](conn *net.Conn, data T) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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