MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / readMasterKey

Function readMasterKey

cmd/cql/internal/cfg.go:154–167  ·  view source on GitHub ↗

readMasterKey reads the password of private key from terminal

(skip bool)

Source from the content-addressed store, hash-verified

152
153// readMasterKey reads the password of private key from terminal
154func readMasterKey(skip bool) string {
155 if skip {
156 return ""
157 }
158 fmt.Println("Enter master key(press Enter for default: \"\"): ")
159 bytePwd, err := terminal.ReadPassword(int(syscall.Stdin))
160 fmt.Println()
161 if err != nil {
162 ConsoleLog.Errorf("read master key failed: %v", err)
163 SetExitStatus(1)
164 Exit()
165 }
166 return string(bytePwd)
167}
168
169func getPublicFromConfig() *asymmetric.PublicKey {
170 configFile = utils.HomeDirExpand(configFile)

Callers 2

configInitFunction · 0.85
runGenerateFunction · 0.85

Calls 4

SetExitStatusFunction · 0.85
ExitFunction · 0.85
PrintlnMethod · 0.80
ErrorfMethod · 0.80

Tested by

no test coverage detected