本文整理匯總了Golang中github.com/keybase/client/go/libkb.User.GetActivePGPKeys方法的典型用法代碼示例。如果您正苦於以下問題:Golang User.GetActivePGPKeys方法的具體用法?Golang User.GetActivePGPKeys怎麽用?Golang User.GetActivePGPKeys使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/keybase/client/go/libkb.User
的用法示例。
在下文中一共展示了User.GetActivePGPKeys方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: PGPCheckMulti
func PGPCheckMulti(me *libkb.User, allowMulti bool) (err error) {
if allowMulti {
return
}
if pgps := me.GetActivePGPKeys(false); len(pgps) > 0 {
err = libkb.KeyExistsError{Key: pgps[0].GetFingerprintP()}
}
return
}
示例2: exportKeysToGPG
func (e *PGPPullEngine) exportKeysToGPG(ctx *Context, user *libkb.User, tfp map[string]bool) error {
for _, bundle := range user.GetActivePGPKeys(false) {
// Check each key against the tracked set.
if tfp != nil && !tfp[bundle.GetFingerprint().String()] {
ctx.LogUI.Warning("Keybase says that %s owns key %s, but you have not tracked this fingerprint before.", user.GetName(), bundle.GetFingerprint())
continue
}
if err := e.gpgClient.ExportKey(*bundle, false /* export public key only */); err != nil {
return err
}
ctx.LogUI.Info("Imported key for %s.", user.GetName())
}
return nil
}