Documentation ¶
Index ¶
- Constants
- Variables
- func GetEntropyCSPRNG(n int) []byte
- func VerifySignature(pubkey ed25519.PublicKey, message, sig []byte) (bool, error)
- type Config
- type KeyFile
- type KeyPair
- type KeyStore
- func (ks *KeyStore) DeriveForFullPath(ipath string) (path string, key *KeyPair, err error)
- func (ks *KeyStore) DeriveForIndexPath(index uint32) (path string, key *KeyPair, err error)
- func (ks *KeyStore) Encrypt(password string) (*KeyFile, error)
- func (ks *KeyStore) FindAddress(address types.Address) (key *KeyPair, index uint32, err error)
- func (ks *KeyStore) Zero()
- type Manager
- func (m *Manager) GetKeyFile(path string) (*KeyFile, error)
- func (m *Manager) GetKeyFileAndDecrypt(path, password string) (*KeyStore, error)
- func (m *Manager) GetKeyStore(path string) (*KeyStore, error)
- func (m *Manager) IsUnlocked(path string) (bool, error)
- func (m *Manager) ListEntropyFilesInStandardDir() ([]*KeyFile, error)
- func (m *Manager) Lock(path string)
- func (m *Manager) MakePathAbsolut(path string) string
- func (m *Manager) Start() error
- func (m *Manager) Stop()
- func (m *Manager) Unlock(path, password string) error
Constants ¶
View Source
const ( ZenonAccountPathFormat = "m/44'/73404'/%d'" FirstHardenedIndex = uint32(0x80000000) )
View Source
const (
DefaultMaxIndex = 128
)
Variables ¶
View Source
var ( ErrKeyFileInvalidVersion = errors.New("unable to read KeyFile. Invalid version") ErrKeyFileInvalidCipher = errors.New("unable to read KeyFile. Invalid cipherName") ErrKeyFileInvalidKDF = errors.New("unable to read KeyFile. Invalid key derivation function (KDF)") ErrAddressNotFound = errors.New("the provided address could not be derived from the key store") ErrWrongPassword = errors.New("the key store could not be decrypted with the provided password") ErrKeyStoreLocked = errors.New("the key store is locked") ErrKeyStoreNotFound = errors.New("the provided key store could not be found in the data directory") ErrInvalidPath = errors.New("invalid derivation path") ErrNoPublicDerivation = errors.New("no public derivation for ed25519") )
Functions ¶
func GetEntropyCSPRNG ¶
Types ¶
type KeyFile ¶
type KeyFile struct { Path string BaseAddress types.Address `json:"baseAddress"` Crypto cryptoParams `json:"crypto"` Version int `json:"version"` Timestamp int64 `json:"timestamp"` }
func ReadKeyFile ¶
type KeyPair ¶
func DeriveForPath ¶
DeriveForPath derives key for chain path in BIP-44 format and chain seed. Ed25119 derivation operated on hardened keys only.
type KeyStore ¶
func (*KeyStore) DeriveForFullPath ¶
func (*KeyStore) DeriveForIndexPath ¶
func (*KeyStore) FindAddress ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) GetKeyFileAndDecrypt ¶
func (*Manager) ListEntropyFilesInStandardDir ¶
ListEntropyFilesInStandardDir reads them from the disk
func (*Manager) MakePathAbsolut ¶
Click to show internal directories.
Click to hide internal directories.