Documentation ¶
Index ¶
- Constants
- func EncryptEntropy(entropy EntropyProfile, passphrase string, useLightScrypt bool) ([]byte, error)
- func FindAddrFromEntropy(entropy EntropyProfile, addr types.Address, extensionWord *string, ...) (key *derivation.Key, index uint32, e error)
- func FullKeyFileName(keysDirPath string, keyAddr types.Address) string
- func NewMnemonic(language string, mnemonicSize *int) (string, error)
- type Config
- type CryptoStore
- type EntropyJSONV1
- type EntropyProfile
- type Manager
- func (km *Manager) DeriveForFullPath(path string, extensionWord *string) (fpath string, key *derivation.Key, err error)
- func (km *Manager) DeriveForFullPathWithPassphrase(path, passphrase string, extensionWord *string) (fpath string, key *derivation.Key, err error)
- func (km *Manager) DeriveForIndexPath(index uint32, extensionWord *string) (path string, key *derivation.Key, err error)
- func (km *Manager) DeriveForIndexPathWithPassphrase(index uint32, passphrase string, extensionWord *string) (path string, key *derivation.Key, err error)
- func (km *Manager) ExtractMnemonic(passphrase string) (string, error)
- func (km *Manager) FindAddr(addr types.Address, extensionWord *string) (key *derivation.Key, index uint32, e error)
- func (km *Manager) FindAddrWithPassphrase(passphrase string, addr types.Address, extensionWord *string) (key *derivation.Key, index uint32, e error)
- func (km Manager) GetEntropyStoreFile() string
- func (km Manager) GetPrimaryAddr() (primaryAddr types.Address)
- func (km *Manager) IsAddrUnlocked(addr types.Address, extensionWord *string) bool
- func (km *Manager) IsUnlocked() bool
- func (km *Manager) ListAddress(from, to uint32, extensionWord *string) ([]types.Address, error)
- func (km *Manager) Lock()
- func (km *Manager) RemoveUnlockChangeChannel()
- func (km *Manager) SetLockEventListener(lis func(event UnlockEvent))
- func (km *Manager) SignData(a types.Address, data []byte, bip44index *uint32, extensionWord *string) (signedData, pubkey []byte, err error)
- func (km *Manager) SignDataWithPassphrase(addr types.Address, passphrase string, data []byte, bip44index *uint32, ...) (signedData, pubkey []byte, err error)
- func (km *Manager) Unlock(passphrase string) error
- type UnlockEvent
Constants ¶
View Source
const ( // StandardScryptN is the N parameter of Scrypt encryption algorithm, using 256MB // memory and taking approximately 1s CPU time on a modern processor. StandardScryptN = 1 << 18 // StandardScryptP is the P parameter of Scrypt encryption algorithm, using 256MB // memory and taking approximately 1s CPU time on a modern processor. StandardScryptP = 1 // memory and taking approximately 100ms CPU time on a modern processor. LightScryptN = 1 << 12 // LightScryptP is the P parameter of Scrypt encryption algorithm, using 4MB // memory and taking approximately 100ms CPU time on a modern processor. LightScryptP = 6 )
View Source
const ( Locked = "Locked" UnLocked = "Unlocked" DefaultMaxIndex = uint32(100) )
Variables ¶
This section is empty.
Functions ¶
func EncryptEntropy ¶
func EncryptEntropy(entropy EntropyProfile, passphrase string, useLightScrypt bool) ([]byte, error)
func FindAddrFromEntropy ¶
func FindAddrFromEntropy(entropy EntropyProfile, addr types.Address, extensionWord *string, maxSearchIndex uint32) (key *derivation.Key, index uint32, e error)
Types ¶
type CryptoStore ¶
func NewCryptoStore ¶
func NewCryptoStore(entropyStoreFilename string, useLightScrypt bool) *CryptoStore
func (CryptoStore) ExtractEntropy ¶
func (ks CryptoStore) ExtractEntropy(passphrase string) (*EntropyProfile, error)
func (CryptoStore) StoreEntropy ¶
func (ks CryptoStore) StoreEntropy(entropy EntropyProfile, passphrase string) error
type EntropyJSONV1 ¶
type EntropyJSONV1 struct { EntropyProfile Id string `json:"uuid"` Crypto cryptoJSON `json:"crypto"` Version int `json:"version"` Timestamp int64 `json:"timestamp"` }
func IsMayValidEntropystoreFile ¶
func IsMayValidEntropystoreFile(path string) (bool, *EntropyJSONV1, error)
it it return false it must not be a valid seedstore file if it return a true it only means that might be true
type EntropyProfile ¶
type EntropyProfile struct { Entropy []byte `json:"-"` MnemonicLang string `json:"mnemonicLang"` UseTwoFactorPhrases bool `json:"useTwoFactorPhrases"` PrimaryAddress *types.Address `json:"primaryAddress"` // contains filtered or unexported fields }
func DecryptEntropy ¶
func DecryptEntropy(entropyJson []byte, passphrase string) (*EntropyProfile, error)
func MnemonicToEntropy ¶
func MnemonicToEntropy(mnemonic, language string, useTwoFactorPhrases bool, extensionWord *string) (entropyprofile *EntropyProfile, e error)
func (*EntropyProfile) ExtractMnemonic ¶
func (ep *EntropyProfile) ExtractMnemonic() (mnemonic string, err error)
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func StoreNewEntropy ¶
func StoreNewEntropy(storeDir, passphrase string, entropyprofile *EntropyProfile, config *Config) (*Manager, error)
func (*Manager) DeriveForFullPath ¶
func (*Manager) DeriveForFullPathWithPassphrase ¶
func (*Manager) DeriveForIndexPath ¶
func (*Manager) DeriveForIndexPathWithPassphrase ¶
func (*Manager) ExtractMnemonic ¶
func (*Manager) FindAddrWithPassphrase ¶
func (Manager) GetEntropyStoreFile ¶
func (Manager) GetPrimaryAddr ¶
func (*Manager) IsAddrUnlocked ¶
func (*Manager) IsUnlocked ¶
func (*Manager) ListAddress ¶
func (*Manager) RemoveUnlockChangeChannel ¶
func (km *Manager) RemoveUnlockChangeChannel()
func (*Manager) SetLockEventListener ¶
func (km *Manager) SetLockEventListener(lis func(event UnlockEvent))
func (*Manager) SignDataWithPassphrase ¶
type UnlockEvent ¶
type UnlockEvent struct { EntropyStoreFile string PrimaryAddr types.Address // represent which seed we use the seed`s PrimaryAddress represents the seed // contains filtered or unexported fields }
func (UnlockEvent) String ¶
func (ue UnlockEvent) String() string
func (UnlockEvent) Unlocked ¶
func (ue UnlockEvent) Unlocked() bool
Click to show internal directories.
Click to hide internal directories.