Documentation ¶
Index ¶
- Constants
- func PasswordToAesKeyHash(password []byte) []byte
- func PasswordToAesKeyScrypt(password []byte, scryptData *ScryptData) ([]byte, error)
- type Account
- type ScryptData
- type Wallet
- func (w *Wallet) ChangePassword(oldPassword, newPassword []byte) error
- func (w *Wallet) GetContract() (*program.ProgramContext, error)
- func (w *Wallet) GetDefaultAccount() (*Account, error)
- func (w *Wallet) Sign(txn *transaction.Transaction) error
- func (w *Wallet) VerifyPassword(password []byte) error
- type WalletData
- type WalletStore
Constants ¶
View Source
const ( IVLength = 16 MasterKeyLength = 32 ScryptSaltLength = 8 ScryptN = 1 << 15 ScryptR = 8 ScryptP = 1 WalletVersion = 2 MinCompatibleWalletVersion = 1 MaxCompatibleWalletVersion = 2 )
Variables ¶
This section is empty.
Functions ¶
func PasswordToAesKeyHash ¶
func PasswordToAesKeyScrypt ¶
func PasswordToAesKeyScrypt(password []byte, scryptData *ScryptData) ([]byte, error)
Types ¶
type Wallet ¶
type Wallet struct { *WalletStore PasswordHash []byte // contains filtered or unexported fields }
func (*Wallet) ChangePassword ¶
func (*Wallet) GetContract ¶
func (w *Wallet) GetContract() (*program.ProgramContext, error)
func (*Wallet) GetDefaultAccount ¶
func (*Wallet) Sign ¶
func (w *Wallet) Sign(txn *transaction.Transaction) error
func (*Wallet) VerifyPassword ¶
type WalletData ¶
type WalletData struct { Version int IV string MasterKey string SeedEncrypted string Address string Scrypt *ScryptData }
func NewWalletData ¶
func NewWalletData(account *Account, password, masterKey, iv, scryptSalt []byte, scryptN, scryptR, scryptP int) (*WalletData, error)
func (*WalletData) DecryptAccount ¶
func (walletData *WalletData) DecryptAccount(password []byte) (*Account, error)
func (*WalletData) DecryptMasterKey ¶
func (walletData *WalletData) DecryptMasterKey(password []byte) ([]byte, error)
func (*WalletData) VerifyPassword ¶
func (walletData *WalletData) VerifyPassword(password []byte) error
type WalletStore ¶
type WalletStore struct { *WalletData Path string sync.RWMutex }
func LoadWalletStore ¶
func LoadWalletStore(fullPath string) (*WalletStore, error)
func NewWalletStore ¶
func NewWalletStore(path string, walletData *WalletData) (*WalletStore, error)
func (*WalletStore) Save ¶
func (s *WalletStore) Save() error
Click to show internal directories.
Click to hide internal directories.