本文整理汇总了Golang中github.com/keybase/client/go/protocol.SigID.ToString方法的典型用法代码示例。如果您正苦于以下问题:Golang SigID.ToString方法的具体用法?Golang SigID.ToString怎么用?Golang SigID.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/keybase/client/go/protocol.SigID
的用法示例。
在下文中一共展示了SigID.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: storeRemoteUntrack
func (e *UntrackEngine) storeRemoteUntrack(them *libkb.User, ctx *Context) (err error) {
e.G().Log.Debug("+ StoreRemoteUntrack")
defer e.G().Log.Debug("- StoreRemoteUntrack -> %s", libkb.ErrToOk(err))
arg := libkb.SecretKeyArg{
Me: e.arg.Me,
KeyType: libkb.DeviceSigningKeyType,
}
var signingKeyPriv libkb.GenericKey
if signingKeyPriv, err = e.G().Keyrings.GetSecretKeyWithPrompt(ctx.LoginContext, arg, ctx.SecretUI, "untracking signature"); err != nil {
return
}
var sig string
var sigid keybase1.SigID
if sig, sigid, err = signingKeyPriv.SignToString(e.untrackStatementBytes); err != nil {
return
}
_, err = e.G().API.Post(libkb.APIArg{
Endpoint: "follow",
NeedSession: true,
Args: libkb.HTTPArgs{
"sig_id_base": libkb.S{Val: sigid.ToString(false)},
"sig_id_short": libkb.S{Val: sigid.ToShortID()},
"sig": libkb.S{Val: sig},
"uid": libkb.UIDArg(them.GetUID()),
"type": libkb.S{Val: "untrack"},
"signing_kid": e.signingKeyPub.GetKID(),
},
})
return
}
示例2: makeKeyArgs
func makeKeyArgs(sigID keybase1.SigID, sig []byte, delType libkb.DelegationType, key libkb.GenericKey, eldestKID, signingKID keybase1.KID) (*libkb.HTTPArgs, error) {
pub, err := key.Encode()
if err != nil {
return nil, err
}
args := libkb.HTTPArgs{
"sig_id_base": libkb.S{Val: sigID.ToString(false)},
"sig_id_short": libkb.S{Val: sigID.ToShortID()},
"sig": libkb.S{Val: string(sig)},
"type": libkb.S{Val: string(delType)},
"is_remote_proof": libkb.B{Val: false},
"public_key": libkb.S{Val: pub},
"eldest_kid": libkb.S{Val: eldestKID.String()},
"signing_kid": libkb.S{Val: signingKID.String()},
}
return &args, nil
}
示例3: CryptocurrencySig
func (u *User) CryptocurrencySig(key GenericKey, address string, sigToRevoke keybase1.SigID) (*jsonw.Wrapper, error) {
ret, err := ProofMetadata{
Me: u,
LinkType: CryptocurrencyType,
SigningKey: key,
}.ToJSON(u.G())
if err != nil {
return nil, err
}
body := ret.AtKey("body")
currencySection := jsonw.NewDictionary()
currencySection.SetKey("address", jsonw.NewString(address))
currencySection.SetKey("type", jsonw.NewString("bitcoin"))
body.SetKey("cryptocurrency", currencySection)
if len(sigToRevoke) > 0 {
revokeSection := jsonw.NewDictionary()
revokeSection.SetKey("sig_id", jsonw.NewString(sigToRevoke.ToString(true /* suffix */)))
body.SetKey("revoke", revokeSection)
}
return ret, nil
}
示例4: CheckPostedViaSigID
func CheckPostedViaSigID(sigID keybase1.SigID) (found bool, status keybase1.ProofStatus, err error) {
res, e2 := G.API.Post(APIArg{
Endpoint: "sig/posted",
NeedSession: true,
Args: HTTPArgs{
"sig_id": S{sigID.ToString(true)},
},
})
if e2 != nil {
err = e2
return
}
var (
rfound bool
rstatus int
rerr error
)
res.Body.AtKey("proof_ok").GetBoolVoid(&rfound, &rerr)
res.Body.AtPath("proof_res.status").GetIntVoid(&rstatus, &rerr)
return rfound, keybase1.ProofStatus(rstatus), rerr
}
示例5: dbKey
func (pc *ProofCache) dbKey(sid keybase1.SigID) (DbKey, string) {
sidstr := sid.ToString(true)
key := DbKey{Typ: DBProofCheck, Key: sidstr}
return key, sidstr
}