Documentation ¶
Index ¶
- func CalculateHashWithoutSign(txBody *types.TxBody) []byte
- func EncryptKey(key []byte, pass string) ([]byte, error)
- func GetKeystore(key *PrivateKey, passphrase string) ([]byte, error)
- func SignTx(tx *types.Tx, key *aergokey) error
- func VerifyTx(tx *types.Tx) error
- func VerifyTxWithAddress(tx *types.Tx, address []byte) error
- type AergoStorage
- type BadgerStorage
- type Identity
- type PrivateKey
- type Storage
- type Store
- func (ks *Store) AddKey(key *btcec.PrivateKey, pass string) (Identity, error)
- func (ks *Store) CloseStore()
- func (ks *Store) CreateKey(pass string) (Identity, error)
- func (ks *Store) ExportKey(addr Identity, pass string) ([]byte, error)
- func (ks *Store) GetAddresses() ([]Identity, error)
- func (ks *Store) GetKey(address []byte, pass string) (*aergokey, error)
- func (ks *Store) ImportKey(imported []byte, oldpass string, newpass string) (Identity, error)
- func (ks *Store) Lock(addr Identity, pass string) (Identity, error)
- func (ks *Store) Sign(addr Identity, pass string, hash []byte) ([]byte, error)
- func (ks *Store) SignTx(tx *types.Tx, requester []byte) error
- func (ks *Store) Unlock(addr Identity, pass string) (Identity, error)
- func (ks *Store) VerifyTx(tx *types.Tx) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateHashWithoutSign ¶
CalculateHashWithoutSign return hash of tx without sign field
func EncryptKey ¶
EncryptKey encrypts a key with a given export for exporting
func GetKeystore ¶
func GetKeystore(key *PrivateKey, passphrase string) ([]byte, error)
GetKeystore encrypts a keystore file
Types ¶
type AergoStorage ¶
func NewAergoStorage ¶
func NewAergoStorage(storePath string) (*AergoStorage, error)
func (*AergoStorage) Close ¶
func (ks *AergoStorage) Close()
func (*AergoStorage) List ¶
func (ks *AergoStorage) List() ([]Identity, error)
func (*AergoStorage) Load ¶
func (ks *AergoStorage) Load(identity Identity, passphrase string) (*PrivateKey, error)
func (*AergoStorage) Save ¶
func (ks *AergoStorage) Save(identity Identity, passphrase string, key *PrivateKey) (Identity, error)
type BadgerStorage ¶
func LoadBadgerStorage ¶
func LoadBadgerStorage(storePath string) (*BadgerStorage, error)
func NewBadgerStorage ¶
func NewBadgerStorage(storePath string) (*BadgerStorage, error)
func (*BadgerStorage) Close ¶
func (ks *BadgerStorage) Close()
func (*BadgerStorage) List ¶
func (ks *BadgerStorage) List() ([]Identity, error)
func (*BadgerStorage) Load ¶
func (ks *BadgerStorage) Load(identity Identity, password string) (*PrivateKey, error)
func (*BadgerStorage) Save ¶
func (ks *BadgerStorage) Save(identity Identity, password string, key *PrivateKey) (Identity, error)
type Identity ¶
type Identity = []byte
Identity is a raw, i.e. decoded address generated from a public key
type PrivateKey ¶
type PrivateKey = btcec.PrivateKey
PrivateKey is a raw, decrypted private key
func LoadKeystore ¶
func LoadKeystore(keystore []byte, passphrase string) (*PrivateKey, error)
LoadKeystore decrypts a keystore file
type Storage ¶
type Storage interface { Save(identity Identity, passphrase string, key *PrivateKey) (Identity, error) Load(identity Identity, passphrase string) (*PrivateKey, error) List() ([]Identity, error) Close() }
Storage defines an interfaces for persistent storage of identities
type Store ¶
Store stucture of keystore
func (*Store) CloseStore ¶
func (ks *Store) CloseStore()
CloseStore locks all addresses and closes the storage
func (*Store) GetAddresses ¶
GetAddresses returns the list of stored addresses
func (*Store) SignTx ¶
SignTx return transaction which signed with unlocked key. if requester is nil, requester is assumed to tx.Account
Source Files ¶
Click to show internal directories.
Click to hide internal directories.