本文整理汇总了Golang中github.com/keybase/client/go/protocol.UserPlusKeys.Keys方法的典型用法代码示例。如果您正苦于以下问题:Golang UserPlusKeys.Keys方法的具体用法?Golang UserPlusKeys.Keys怎么用?Golang UserPlusKeys.Keys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/keybase/client/go/protocol.UserPlusKeys
的用法示例。
在下文中一共展示了UserPlusKeys.Keys方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: ExportToUserPlusKeys
func (u *User) ExportToUserPlusKeys(idTime keybase1.Time) keybase1.UserPlusKeys {
ret := keybase1.UserPlusKeys{
Uid: u.GetUID(),
Username: u.GetName(),
}
ckf := u.GetComputedKeyFamily()
if ckf != nil {
// DeviceKeys is poorly named, so let's deprecate it.
ret.DeviceKeys = ckf.Export()
ret.Keys = ret.DeviceKeys
}
ret.Uvv = u.ExportToVersionVector(idTime)
return ret
}
示例2: filterKeys
func (e *DeviceKeyfinder) filterKeys(upk *keybase1.UserPlusKeys) error {
var keys []keybase1.PublicKey
hasPGP := false
for _, key := range upk.Keys {
if len(key.PGPFingerprint) != 0 {
hasPGP = true
continue
}
if e.arg.NeedVerifyKeys && !libkb.KIDIsDeviceVerify(key.KID) {
continue
}
if e.arg.NeedEncryptKeys && !libkb.KIDIsDeviceEncrypt(key.KID) {
continue
}
keys = append(keys, key)
}
if len(keys) == 0 {
return libkb.NoNaClEncryptionKeyError{User: upk.Username, HasPGPKey: hasPGP}
}
upk.Keys = keys
return nil
}