protoutil

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: MIT Imports: 13 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 CreateMessage added in v0.5.0

func CreateMessage(privateKey *easyecc.PrivateKey, body []byte, sender, receiver string,
	receiverKey *easyecc.PublicKey) (*pb.DMSMessage, error)

CreateMessages creates a new DMSMessage, signed and encrypted.

func CreateSigned added in v0.5.0

func CreateSigned(privateKey *easyecc.PrivateKey, content []byte) (*pb.Signed, error)

CreateSigned creates a signature for the given content.

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

SendMessage creates a new DMSMessage and sends it out to the appropriate address.

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