profile

package
v0.0.0-...-32f009b Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2018 License: MIT Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InvalidIdentityPublicKey = errors.New("identity public key invalid - must have 32 bytes")
	InvalidEthereumPublicKey = errors.New("ethereum public key invalid - must have 33 bytes")
	InvalidChatIDKey         = errors.New("chat identity key invalid - must have 32 bytes")
)

Functions

This section is empty.

Types

type Information

type Information struct {
	Name           string
	Location       string
	Image          string
	IdentityPubKey []byte
	EthereumPubKey []byte
	ChatIDKey      x3dh.PublicKey
	Timestamp      time.Time
	Version        uint8
}

type Profile

type Profile struct {
	Information Information
	Signatures  Signatures
}

func ProtobufToProfile

func ProtobufToProfile(prof *pb.Profile) (*Profile, error)

func SignProfile

func SignProfile(name, location, image string, km km.KeyManager) (*Profile, error)

sign the metadata with identity and ethereum key

func SignWithKeyManagerStore

func SignWithKeyManagerStore(name, location, image string, keyManagerStore km.Store, password string) (*Profile, error)

sign's a profile without the need to start panthalassa

func (*Profile) EthereumAddress

func (p *Profile) EthereumAddress() (common.Address, error)

get ethereum address based on profile ethereum public key

func (*Profile) EthereumPublicKey

func (p *Profile) EthereumPublicKey() ([]byte, error)

func (*Profile) Hash

func (p *Profile) Hash() (mh.Multihash, error)

hash all information about a profile

func (*Profile) IdentityPublicKey

func (p *Profile) IdentityPublicKey() (ed25519.PublicKey, error)

func (Profile) SignaturesValid

func (p Profile) SignaturesValid() (bool, error)

check if signatures of profile are correct

func (*Profile) ToProtobuf

func (p *Profile) ToProtobuf() (*pb.Profile, error)

Convert profile to protobuf

func (*Profile) ValidEthereumSignature

func (p *Profile) ValidEthereumSignature(msg [32]byte, signature [65]byte) (bool, error)

Validate signature based on the ethereum public key

func (*Profile) ValidIdentitySignature

func (p *Profile) ValidIdentitySignature(msg, signature []byte) (bool, error)

Validate signature based on identity pubic key

type Signatures

type Signatures struct {
	IdentityKey []byte
	EthereumKey []byte
}

Jump to

Keyboard shortcuts

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