incognitokey

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvalidPrivateKeyErr = iota
	B58DecodePubKeyErr
	B58DecodeSigErr
	B58ValidateErr
	InvalidDataValidateErr
	SignDataB58Err
	InvalidDataSignErr
	InvalidVerificationKeyErr
	DecodeFromStringErr
	SignError
	JSONError
)

Variables

View Source
var ErrCodeMessage = map[int]struct {
	Code    int
	Message string
}{
	InvalidPrivateKeyErr:      {-201, "Private key is invalid"},
	B58DecodePubKeyErr:        {-202, "Base58 decode pub key error"},
	B58DecodeSigErr:           {-203, "Base58 decode signature error"},
	B58ValidateErr:            {-204, "Base58 validate data error"},
	InvalidDataValidateErr:    {-205, "Validated base58 data is invalid"},
	SignDataB58Err:            {-206, "Signing B58 data error"},
	InvalidDataSignErr:        {-207, "Signed data is invalid"},
	InvalidVerificationKeyErr: {-208, "Verification key is invalid"},
	DecodeFromStringErr:       {-209, "Decode key set from string error"},
	SignError:                 {-210, "Can not sign data"},
	JSONError:                 {-211, "JSON Marshal, Unmarshal error"},
}
View Source
var GetMiningKeyBase58Cache, _ = lru.New(2000)
View Source
var ToBase58Cache, _ = lru.New(2000)

Functions

This section is empty.

Types

type CashecError

type CashecError struct {
	Code    int
	Message string
	// contains filtered or unexported fields
}

func NewCashecError

func NewCashecError(key int, err error) *CashecError

func (CashecError) Error

func (e CashecError) Error() string

func (CashecError) GetCode

func (e CashecError) GetCode() int

type CommitteeKeyString

type CommitteeKeyString struct {
	IncPubKey    string
	MiningPubKey map[string]string
}

type CommitteePublicKey

type CommitteePublicKey struct {
	IncPubKey    privacy.PublicKey
	MiningPubKey map[string][]byte
}

func NewCommitteeKeyFromSeed

func NewCommitteeKeyFromSeed(seed, incPubKey []byte) (CommitteePublicKey, error)

func NewCommitteePublicKey

func NewCommitteePublicKey() *CommitteePublicKey

func (*CommitteePublicKey) Bytes

func (pubKey *CommitteePublicKey) Bytes() ([]byte, error)

func (*CommitteePublicKey) CheckSanityData

func (pubKey *CommitteePublicKey) CheckSanityData() bool

func (*CommitteePublicKey) FromBase58

func (pubKey *CommitteePublicKey) FromBase58(keyString string) error

func (*CommitteePublicKey) FromBytes

func (pubKey *CommitteePublicKey) FromBytes(keyBytes []byte) error

func (*CommitteePublicKey) FromString

func (pubKey *CommitteePublicKey) FromString(keyString string) error

func (*CommitteePublicKey) GetIncKeyBase58

func (pubKey *CommitteePublicKey) GetIncKeyBase58() string

func (*CommitteePublicKey) GetMiningKey

func (pubKey *CommitteePublicKey) GetMiningKey(schemeName string) ([]byte, error)

func (*CommitteePublicKey) GetMiningKeyBase58

func (pubKey *CommitteePublicKey) GetMiningKeyBase58(schemeName string) string

func (*CommitteePublicKey) GetNormalKey

func (pubKey *CommitteePublicKey) GetNormalKey() []byte

func (*CommitteePublicKey) IsEqual

func (committeePublicKey *CommitteePublicKey) IsEqual(target CommitteePublicKey) bool

func (*CommitteePublicKey) IsEqualMiningPubKey

func (pubKey *CommitteePublicKey) IsEqualMiningPubKey(consensusName string, k *CommitteePublicKey) bool

func (*CommitteePublicKey) IsValid

func (committeePublicKey *CommitteePublicKey) IsValid(target CommitteePublicKey) bool

func (*CommitteePublicKey) RawBytes

func (pubKey *CommitteePublicKey) RawBytes() ([]byte, error)

func (*CommitteePublicKey) ToBase58

func (pubKey *CommitteePublicKey) ToBase58() (string, error)

type KeySet

type KeySet struct {
	PrivateKey     privacy.PrivateKey
	PaymentAddress privacy.PaymentAddress
	ReadonlyKey    privacy.ViewingKey
}

KeySet is real raw data of wallet account, which user can use to - spend and check double spend coin with private key - receive coin with payment address - read tx data with readonly key

func (*KeySet) GenerateKey

func (keySet *KeySet) GenerateKey(seed []byte) *KeySet

GenerateKey generates key set from seed in byte array

func (*KeySet) InitFromPrivateKey

func (keySet *KeySet) InitFromPrivateKey(privateKey *privacy.PrivateKey) error

InitFromPrivateKey receives private key in PrivateKey type, and regenerates payment address and readonly key returns error if private key is invalid

func (*KeySet) InitFromPrivateKeyByte

func (keySet *KeySet) InitFromPrivateKeyByte(privateKey []byte) error

InitFromPrivateKeyByte receives private key in bytes array, and regenerates payment address and readonly key returns error if private key is invalid

Jump to

Keyboard shortcuts

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