bmail

package module
v0.0.0-...-4cfad50 Latest Latest
Warning

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

Go to latest
Published: May 26, 2020 License: GPL-2.0 Imports: 8 Imported by: 0

README

go-email-account

bmail account lib

Documentation

Index

Constants

View Source
const (
	AccPrefix = "BM"
	AccIDLen  = 40
)

Variables

View Source
var BMWalletVersion = 1

Functions

func Verify

func Verify(addr Address, data, sig []byte) bool

Types

type Address

type Address string

func ToAddress

func ToAddress(key []byte) Address

func (Address) IsValid

func (addr Address) IsValid() bool

func (Address) String

func (addr Address) String() string

func (Address) ToPubKey

func (addr Address) ToPubKey() ed25519.PublicKey

type BMWallet

type BMWallet struct {
	Version   int                `json:"version"`
	Addr      Address            `json:"address"`
	MailAddr  string             `json:"bmail"`
	CipherTxt string             `json:"cipher"`
	PriKey    ed25519.PrivateKey `json:"-"`
}

func (*BMWallet) Address

func (bmw *BMWallet) Address() Address

func (*BMWallet) AeskeyOf

func (bmw *BMWallet) AeskeyOf(peerPub []byte) ([]byte, error)

func (*BMWallet) Close

func (bmw *BMWallet) Close()

func (*BMWallet) IsOpen

func (bmw *BMWallet) IsOpen() bool

func (*BMWallet) MailAddress

func (bmw *BMWallet) MailAddress() string

func (*BMWallet) Open

func (bmw *BMWallet) Open(auth string) error

func (*BMWallet) SaveToPath

func (bmw *BMWallet) SaveToPath(path string) error

func (*BMWallet) Seeds

func (bmw *BMWallet) Seeds() []byte

func (*BMWallet) SetMailName

func (bmw *BMWallet) SetMailName(mailName string)

func (*BMWallet) Sign

func (bmw *BMWallet) Sign(v []byte) []byte

func (*BMWallet) SignObj

func (bmw *BMWallet) SignObj(v interface{}) ([]byte, error)

func (*BMWallet) String

func (bmw *BMWallet) String() string

type Wallet

type Wallet interface {
	Address() Address
	MailAddress() string
	String() string
	IsOpen() bool
	Open(auth string) error
	Close()
	SaveToPath(path string) error
	Sign(v []byte) []byte
	SignObj(v interface{}) ([]byte, error)
	SetMailName(mailName string)
	AeskeyOf(peerPub []byte) ([]byte, error)
	Seeds() []byte
}

func LoadWallet

func LoadWallet(wPath string) (Wallet, error)

func LoadWalletByData

func LoadWalletByData(jsonStr string) (Wallet, error)

func NewWallet

func NewWallet(auth string) (Wallet, error)

Jump to

Keyboard shortcuts

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