cli

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KeyCryptTypePWD key crypt using password
	KeyCryptTypePWD = 0
	// KeyCryptTypeSSS key crypt using Shamir's Secret Sharing scheme
	KeyCryptTypeSSS = 1
)

Variables

This section is empty.

Functions

func ChangeCipherPwd

func ChangeCipherPwd(cipherDir string)

ChangeCipherPwd changes password

func ExportEmergencyFile

func ExportEmergencyFile(cipherDir, outpath string)

ExportEmergencyFile read information and key of a cipher directory

save them to an outer file specified by user

func InfoCipherDir

func InfoCipherDir(cipherDir string)

InfoCipherDir print information about a cipher directory

func InitCipherDir

func InitCipherDir(cipherDir string)

InitCipherDir initialize a cipher directory

func LoadKey

func LoadKey(cipherDir string, pwdfile string, password string) []byte

LoadKey load encryption key of the cipher directory

func LoadKeySSS

func LoadKeySSS(pathsStr string) []byte

LoadKeySSS load encryption key using sss

func RecoverCipherDir

func RecoverCipherDir(cipherDir, emerFile string)

RecoverCipherDir recovers the cipher dir using emergency file

func SaveConf

func SaveConf(path string, cf CipherConfig) error

SaveConf save cipher conf file to disk

func SaveKey

func SaveKey(cipherDir string, key []byte)

SaveKey ask for password, encrypted key using the password and then save to file

func SaveKeySSS

func SaveKeySSS(cipherDir string, key []byte)

SaveKeySSS ask sss params and place to save then save keyshares

Types

type Args

type Args struct {
	CipherDir  string
	MountPoint string
	PwdFile    string
	Password   string
	Emergency  string
	KeyFiles   string
	DebugFuse  bool
	Debug      bool
	Init       bool
	Info       bool
	ChangePwd  bool
	Export     bool
	Recover    bool
	Foreground bool
	AllowOther bool
	ParentPid  int
}

Args contains cli args value

func ParseArgs

func ParseArgs() (args Args)

ParseArgs parse args from cli args

type CipherConfig

type CipherConfig struct {
	Version      int
	CryptType    int
	CryptTypeStr string
	PlainBS      int
	KeyCryptType int
	PlainPath    bool
}

CipherConfig is the content of a config file.

func LoadConf

func LoadConf(cipherDir string) CipherConfig

LoadConf load config of the cipher directory

func LoadEmergencyFile

func LoadEmergencyFile(path string) (CipherConfig, []byte)

LoadEmergencyFile load conf and key from a emergency file

func ReadConf

func ReadConf(path string) (cf CipherConfig)

ReadConf read cipher conf from file and parse it

func (*CipherConfig) String

func (cfg *CipherConfig) String() string

type EmergencyConfig

type EmergencyConfig struct {
	CipherConfig
	EmergencyKey string
}

EmergencyConfig is the content of a emergency file.

Jump to

Keyboard shortcuts

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