forked from keybase/client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gpg.go
40 lines (32 loc) · 1.16 KB
/
gpg.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2015 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.
package service
import (
keybase1 "github.com/keybase/client/go/protocol"
rpc "github.com/keybase/go-framed-msgpack-rpc"
"golang.org/x/net/context"
)
type RemoteGPGUI struct {
sessionID int
uicli keybase1.GpgUiClient
}
func NewRemoteGPGUI(sessionID int, c *rpc.Client) *RemoteGPGUI {
return &RemoteGPGUI{
sessionID: sessionID,
uicli: keybase1.GpgUiClient{Cli: c},
}
}
func (r *RemoteGPGUI) SelectKey(ctx context.Context, arg keybase1.SelectKeyArg) (string, error) {
arg.SessionID = r.sessionID
return r.uicli.SelectKey(ctx, arg)
}
func (r *RemoteGPGUI) SelectKeyAndPushOption(ctx context.Context, arg keybase1.SelectKeyAndPushOptionArg) (keybase1.SelectKeyRes, error) {
arg.SessionID = r.sessionID
return r.uicli.SelectKeyAndPushOption(ctx, arg)
}
func (r *RemoteGPGUI) WantToAddGPGKey(ctx context.Context, _ int) (bool, error) {
return r.uicli.WantToAddGPGKey(ctx, r.sessionID)
}
func (r *RemoteGPGUI) ConfirmDuplicateKeyChosen(ctx context.Context, _ int) (bool, error) {
return r.uicli.ConfirmDuplicateKeyChosen(ctx, r.sessionID)
}