Documentation ¶
Index ¶
- Constants
- func CloseDB(dbptr Export_C_Int)
- func MakeMsgHash(msg ...[]byte) []byte
- func NewLevelDBHandler(dbpath *Export_C_Char) C.int
- func NewWalletHandler(dbptr Export_C_Int, wltname *Export_C_Char) C.int
- func NewWalletHandlerFromDB(dbptr Export_C_Int, wltname *Export_C_Char) C.int
- func PreCheckWallet(wltptr Export_C_Int) C.int
- func WalletAddress(wltptr Export_C_Int, idx Export_C_Int) unsafe.Pointer
- func WalletExist(db *leveldb.DB, name string) (bool, error)
- func WalletSign(wltptr Export_C_Int, idx Export_C_Int, msg unsafe.Pointer, ...) unsafe.Pointer
- func WalletSignHash(wltptr Export_C_Int, idx Export_C_Int, msgHash unsafe.Pointer) unsafe.Pointer
- func WalletVerifyByHash(wltptr Export_C_Int, idx Export_C_Int, signature unsafe.Pointer, ...) C.int
- func WalletVerifyByRaw(wltptr Export_C_Int, idx Export_C_Int, signature unsafe.Pointer, ...) C.int
- type Account
- type Export_C_Char
- type Export_C_Int
- type Wallet
- func (wlt *Wallet) AppendAccount(acc *Account)
- func (wlt *Wallet) Save() error
- func (wlt *Wallet) Sign(idx int, msg ...[]byte) []byte
- func (wlt *Wallet) SignHash(idx int, msgHash []byte) []byte
- func (wlt *Wallet) String() string
- func (wlt *Wallet) VerifyByHash(idx int, signature []byte, msgHash []byte) bool
- func (wlt *Wallet) VerifyByRaw(idx int, signature []byte, msg ...[]byte) bool
Constants ¶
View Source
const ( CodeInvalidDBPtr = -1 - iota CodeInvalidWalletPtr CodeInvalidIndex CodeIOError )
View Source
const (
// max number of onload-dbs
MXONLOADDB = 64
)
Variables ¶
This section is empty.
Functions ¶
func CloseDB ¶
func CloseDB(dbptr Export_C_Int)
func MakeMsgHash ¶
func NewLevelDBHandler ¶
func NewLevelDBHandler(dbpath *Export_C_Char) C.int
func NewWalletHandler ¶
func NewWalletHandler(dbptr Export_C_Int, wltname *Export_C_Char) C.int
func NewWalletHandlerFromDB ¶
func NewWalletHandlerFromDB(dbptr Export_C_Int, wltname *Export_C_Char) C.int
func PreCheckWallet ¶
func PreCheckWallet(wltptr Export_C_Int) C.int
func WalletAddress ¶
func WalletAddress(wltptr Export_C_Int, idx Export_C_Int) unsafe.Pointer
func WalletSign ¶
func WalletSign(wltptr Export_C_Int, idx Export_C_Int, msg unsafe.Pointer, msgSize Export_C_Int) unsafe.Pointer
func WalletSignHash ¶
func WalletSignHash(wltptr Export_C_Int, idx Export_C_Int, msgHash unsafe.Pointer) unsafe.Pointer
func WalletVerifyByHash ¶
func WalletVerifyByHash(wltptr Export_C_Int, idx Export_C_Int, signature unsafe.Pointer, msgHash unsafe.Pointer) C.int
func WalletVerifyByRaw ¶
func WalletVerifyByRaw(wltptr Export_C_Int, idx Export_C_Int, signature unsafe.Pointer, msg unsafe.Pointer, msgSize Export_C_Int) C.int
Types ¶
type Account ¶
type Account struct { PrivateKey eddsa.PrivateKey `json:"pri"` PublicKey eddsa.PublicKey `json:"pub"` }
func NewAccount ¶
func ReadAccount ¶
func (*Account) VerifyByHash ¶
type Export_C_Char ¶
type Export_C_Int ¶
type Wallet ¶
type Wallet struct { Acc []*Account `json:"accs"` // contains filtered or unexported fields }
func (*Wallet) AppendAccount ¶
func (*Wallet) VerifyByHash ¶
Click to show internal directories.
Click to hide internal directories.