protoutil

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckNameAvailability

func CheckNameAvailability(ctx context.Context, client pb.LookupServiceClient, name string) (bool, error)

func CreateSignedWithPOW

func CreateSignedWithPOW(privateKey *easyecc.PrivateKey, content []byte, powStrength int) (*pb.SignedWithPow, error)

CreateSignedWithPOW creates a request signed with the given private key and generates POW of the given strength.

func DecryptMessage added in v0.4.0

func DecryptMessage(ctx context.Context, lookupClient pb.LookupServiceClient, privateKey *easyecc.PrivateKey, msg *pb.DMSMessage) (string, error)

func IdentityProof added in v0.4.0

func IdentityProof(key *easyecc.PrivateKey) *pb.Signed

IdentityProof generates an identity proof that can be used in receive requests.

func RegisterAddress

func RegisterAddress(ctx context.Context, client pb.IdentityServiceClient, key *easyecc.PrivateKey,
	targetKey *easyecc.PublicKey, name string, address string, powStrength int) error

func RegisterChildKey

func RegisterChildKey(ctx context.Context, client pb.IdentityServiceClient, key *easyecc.PrivateKey,
	childKey *easyecc.PublicKey, powStrength int) error

func RegisterKey

func RegisterKey(ctx context.Context, client pb.IdentityServiceClient, key *easyecc.PrivateKey, powStrength int) error

func RegisterName

func RegisterName(ctx context.Context, client pb.IdentityServiceClient, key *easyecc.PrivateKey,
	targetKey *easyecc.PublicKey, name string, powStrength int) error

func SendMessage

func SendMessage(ctx context.Context, privateKey *easyecc.PrivateKey, body []byte,
	sender, receiver string, lookupService pb.LookupServiceClient) error

func VerifySignature

func VerifySignature(sig *pb.Signature, serializedKey []byte, content []byte) bool

VerifySignature returns true if the provided signature is valid for the given key and content.

Types

This section is empty.

Jump to

Keyboard shortcuts

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