client

package
v0.9.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2022 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanMessagesClientSide added in v0.8.5

func CleanMessagesClientSide(messages []model.Message) []model.Message

CleanMessagesOutFromDB get data from DB and do some checks and verifications

func CleanSingleMessageClientSide added in v0.8.5

func CleanSingleMessageClientSide(message model.Message) model.Message

func GetMessagesFrom

func GetMessagesFrom(servers []string, path string) []model.Message

func GetSingleMessageFromEachPod

func GetSingleMessageFromEachPod(servers []string, path string) model.Message

Try to get a singl message from each pod specified

func SignMessage added in v0.9.0

func SignMessage(msg model.Message, secretKey string) (string, error)

SignMessage normalizes the message and signs it with `secretKey`

func SignStrings added in v0.9.0

func SignStrings(secBase64, pubBase64, displayedName, message, messageId string) string

SignMessage signs messages from base64 and return a base64 signature (empty string if the signature can't be generated) The signature contains these elements concatenated: The message (UTF-8 to bytes) The author's public key The author's declared name The eventual messageId, empty if this is an original post

func VerifyFromString added in v0.9.0

func VerifyFromString(pub, sig, displayedName, msg, msgId string) bool

Types

type KeyGen added in v0.8.5

type KeyGen struct {
	Pub            string
	NewPub         string
	ColorPrimary   string // Preview of the primary color of generated key pair
	ColorSecondary string // Preview of the secondary color of generated key pair
	Sec            string
	NewSec         string
	Sig            string
	DisplayedName  string
	Content        string
	MessageID      string
	Verif          bool
	Valid          bool
}

func GenKeys added in v0.8.5

func GenKeys() KeyGen

GenKeys generates (cryptographically secured) a new pair of ed25519 keys

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL