예제 #1
0
func (c *CmdUnlock) Run() error {
	cli, err := GetLoginClient(G)
	if err != nil {
		return err
	}
	protocols := []rpc.Protocol{
		NewSecretUIProtocol(G),
	}
	if err := RegisterProtocols(protocols); err != nil {
		return err
	}
	return cli.Unlock(context.TODO(), 0)
}
예제 #2
0
func (c *CmdUnlock) Run() error {
	cli, err := GetLoginClient(G)
	if err != nil {
		return err
	}
	protocols := []rpc.Protocol{
		NewSecretUIProtocol(G),
	}
	if err := RegisterProtocols(protocols); err != nil {
		return err
	}
	if c.stdin {
		stdinBytes, err := ioutil.ReadAll(os.Stdin)
		if err != nil {
			return err
		}
		return cli.UnlockWithPassphrase(context.TODO(), keybase1.UnlockWithPassphraseArg{
			Passphrase: string(stdinBytes),
		})
	}
	return cli.Unlock(context.TODO(), 0)
}