()
| 50 | } |
| 51 | |
| 52 | func (kb *Keybase) GeneratePostPayload() (post map[string]string) { |
| 53 | kb.Identity = strings.ToLower(kb.Identity) |
| 54 | payload := KeybasePayload{ |
| 55 | Version: "1", |
| 56 | Comment: "Here's an NextID proof of this Keybase account.", |
| 57 | Comment2: "To validate, base64.decode the signature, and recover pubkey from it using sign_payload with ethereum personal_sign algo.", |
| 58 | Persona: "0x" + mycrypto.CompressedPubkeyHex(kb.Pubkey), |
| 59 | KeybaseUsername: kb.Identity, |
| 60 | SignPayload: kb.GenerateSignPayload(), |
| 61 | Signature: "%SIG_BASE64%", |
| 62 | CreatedAt: util.TimeToTimestampString(kb.CreatedAt), |
| 63 | Uuid: kb.Uuid.String(), |
| 64 | } |
| 65 | payload_json, _ := json.MarshalIndent(payload, "", "\t") |
| 66 | return map[string]string{"default": string(payload_json)} |
| 67 | } |
| 68 | |
| 69 | func (kb *Keybase) GenerateSignPayload() (payload string) { |
| 70 | kb.Identity = strings.ToLower(kb.Identity) |
nothing calls this directly
no test coverage detected