helpers

package
v0.0.0-...-04dd476 Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OptionsDecrypt struct {
	Archive string `short:"a" long:"archive" required:"yes" description:"Path to the encrypted archive"`
}
View Source
var OptionsEncrypt struct {
	Keyfile string `short:"k" long:"keyfile" required:"yes" description:"Path to the keyfile required for encryption"`
	File    string `short:"f" long:"file" required:"yes" description:"File to encrypt"`
}
View Source
var OptionsGenerate struct {
	Output  string `short:"o" long:"output" required:"yes" description:"Filename for the new key pair"`
	Minimum int    `short:"m" long:"min" required:"yes" description:"Minimum of shares needed to retrieve the private key"`
	Total   int    `short:"t" long:"total" required:"yes" description:"Total number of secret shares, has to be higher than minimum"`
}

Functions

func DecryptMessage

func DecryptMessage(key []byte, message string) (string, error)

func EncryptMessage

func EncryptMessage(key []byte, message string) (string, error)

func ErrorAndExit

func ErrorAndExit(err error)

func GeneratePassphrase

func GeneratePassphrase() (string, error)

func ReadAll

func ReadAll(file *zip.File) []byte

func ScreenClear

func ScreenClear()

func WaitForEnter

func WaitForEnter()

func WriteBinaryFileToDisk

func WriteBinaryFileToDisk(path string, content []byte) error

func WriteFileToDisk

func WriteFileToDisk(path string, content string) error

Types

type KeysFile

type KeysFile struct {
	Minimum    int    `json:"minimum_shares"`
	Total      int    `json:"total_shares"`
	CreatedOn  string `json:"created_on"`
	PublicKey  string `json:"public_key"`
	PrivateKey string `json:"private_key"`
}

Jump to

Keyboard shortcuts

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