github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/protocol/keybase1/kex2provisionee2.go (about)

     1  // Auto-generated to Go types and interfaces using avdl-compiler v1.4.10 (https://github.com/keybase/node-avdl-compiler)
     2  //   Input file: avdl/keybase1/kex2provisionee2.avdl
     3  
     4  package keybase1
     5  
     6  import (
     7  	"github.com/keybase/go-framed-msgpack-rpc/rpc"
     8  	context "golang.org/x/net/context"
     9  	"time"
    10  )
    11  
    12  type Hello2Res struct {
    13  	EncryptionKey KID      `codec:"encryptionKey" json:"encryptionKey"`
    14  	SigPayload    HelloRes `codec:"sigPayload" json:"sigPayload"`
    15  	DeviceEkKID   KID      `codec:"deviceEkKID" json:"deviceEkKID"`
    16  }
    17  
    18  func (o Hello2Res) DeepCopy() Hello2Res {
    19  	return Hello2Res{
    20  		EncryptionKey: o.EncryptionKey.DeepCopy(),
    21  		SigPayload:    o.SigPayload.DeepCopy(),
    22  		DeviceEkKID:   o.DeviceEkKID.DeepCopy(),
    23  	}
    24  }
    25  
    26  type PerUserKeyBox struct {
    27  	Generation  PerUserKeyGeneration `codec:"generation" json:"generation"`
    28  	Box         string               `codec:"box" json:"box"`
    29  	ReceiverKID KID                  `codec:"receiverKID" json:"receiver_kid"`
    30  }
    31  
    32  func (o PerUserKeyBox) DeepCopy() PerUserKeyBox {
    33  	return PerUserKeyBox{
    34  		Generation:  o.Generation.DeepCopy(),
    35  		Box:         o.Box,
    36  		ReceiverKID: o.ReceiverKID.DeepCopy(),
    37  	}
    38  }
    39  
    40  type Hello2Arg struct {
    41  	Uid     UID          `codec:"uid" json:"uid"`
    42  	Token   SessionToken `codec:"token" json:"token"`
    43  	Csrf    CsrfToken    `codec:"csrf" json:"csrf"`
    44  	SigBody string       `codec:"sigBody" json:"sigBody"`
    45  }
    46  
    47  type DidCounterSign2Arg struct {
    48  	Sig          []byte         `codec:"sig" json:"sig"`
    49  	PpsEncrypted string         `codec:"ppsEncrypted" json:"ppsEncrypted"`
    50  	PukBox       *PerUserKeyBox `codec:"pukBox,omitempty" json:"pukBox,omitempty"`
    51  	UserEkBox    *UserEkBoxed   `codec:"userEkBox,omitempty" json:"userEkBox,omitempty"`
    52  }
    53  
    54  type Kex2Provisionee2Interface interface {
    55  	Hello2(context.Context, Hello2Arg) (Hello2Res, error)
    56  	DidCounterSign2(context.Context, DidCounterSign2Arg) error
    57  }
    58  
    59  func Kex2Provisionee2Protocol(i Kex2Provisionee2Interface) rpc.Protocol {
    60  	return rpc.Protocol{
    61  		Name: "keybase.1.Kex2Provisionee2",
    62  		Methods: map[string]rpc.ServeHandlerDescription{
    63  			"hello2": {
    64  				MakeArg: func() interface{} {
    65  					var ret [1]Hello2Arg
    66  					return &ret
    67  				},
    68  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
    69  					typedArgs, ok := args.(*[1]Hello2Arg)
    70  					if !ok {
    71  						err = rpc.NewTypeError((*[1]Hello2Arg)(nil), args)
    72  						return
    73  					}
    74  					ret, err = i.Hello2(ctx, typedArgs[0])
    75  					return
    76  				},
    77  			},
    78  			"didCounterSign2": {
    79  				MakeArg: func() interface{} {
    80  					var ret [1]DidCounterSign2Arg
    81  					return &ret
    82  				},
    83  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
    84  					typedArgs, ok := args.(*[1]DidCounterSign2Arg)
    85  					if !ok {
    86  						err = rpc.NewTypeError((*[1]DidCounterSign2Arg)(nil), args)
    87  						return
    88  					}
    89  					err = i.DidCounterSign2(ctx, typedArgs[0])
    90  					return
    91  				},
    92  			},
    93  		},
    94  	}
    95  }
    96  
    97  type Kex2Provisionee2Client struct {
    98  	Cli rpc.GenericClient
    99  }
   100  
   101  func (c Kex2Provisionee2Client) Hello2(ctx context.Context, __arg Hello2Arg) (res Hello2Res, err error) {
   102  	err = c.Cli.Call(ctx, "keybase.1.Kex2Provisionee2.hello2", []interface{}{__arg}, &res, 0*time.Millisecond)
   103  	return
   104  }
   105  
   106  func (c Kex2Provisionee2Client) DidCounterSign2(ctx context.Context, __arg DidCounterSign2Arg) (err error) {
   107  	err = c.Cli.Call(ctx, "keybase.1.Kex2Provisionee2.didCounterSign2", []interface{}{__arg}, nil, 0*time.Millisecond)
   108  	return
   109  }