Documentation ¶
Index ¶
- Constants
- func AddPrefixPubKeyHash(pubkeyhash string) string
- func Generate32BitKey(path string) (key []byte, e error)
- func GenerateGoMarconiKey() (*keystore.Key, error)
- func ListAccounts() []string
- func StripPrefixPubKeyHash(pubkeyhash string) string
- type EncryptedMarconiKeyJSON
- type MarconiAccount
- func (m *MarconiAccount) ExportGoMarconiKeystore(path string) error
- func (m *MarconiAccount) ExportMarconiKeys(password string) error
- func (m *MarconiAccount) GenerateMarconiKey(password string) (*EncryptedMarconiKeyJSON, error)
- func (m *MarconiAccount) GetGoMarconiKey(password string) (*keystore.Key, error)
- func (m *MarconiAccount) UseMarconiKey(mpkeyId string, password string) error
- type MpkeyListItem
Constants ¶
const ( ACCOUNT_CHILD_DIR = "/accounts" ACCOUNT_FILE_PREFIX = "Account_Key" MARCONI_PRIVATE_KEY_FILENAME = "mpkey" MAX_MARCONI_PRIVATE_KEYS = 16 MARCONI_KEY_CHILD_DIR = "/etc/marconid/keys" MARCONI_KEY_FILENAME_SUFFIX = "_mpkeys" MARCONI_PUBLIC_KEY_FILE_EXT = ".pub" )
const (
NODE_PREFIX = "Nx"
)
Variables ¶
This section is empty.
Functions ¶
func AddPrefixPubKeyHash ¶
func Generate32BitKey ¶
func GenerateGoMarconiKey ¶
Generate a new GoMarconi private key
func ListAccounts ¶
func ListAccounts() []string
Returns the addresses of the Marconi accounts stored under the accounts directory
func StripPrefixPubKeyHash ¶
Types ¶
type EncryptedMarconiKeyJSON ¶
type EncryptedMarconiKeyJSON struct { PublicKeyHash string `json:"pubKeyHash"` EncryptedMPKey string `json:"encryptedMPkey"` Nonce string `json:"nonce"` Salt string `json:"salt"` N int `json:"n"` R int `json:"r"` P int `json:"p"` KeyLen int `json:"keylen"` }
Struct equivalent of the JSON format used to store an Encrypted Marconi Node Private Key
type MarconiAccount ¶
type MarconiAccount struct { GMrcKeystore keystore.EncryptedKeyJSONV3 `json:"gMrcKeystore"` MarconiKeys []EncryptedMarconiKeyJSON `json:"marconiKeys"` // contains filtered or unexported fields }
MarconiAccount contains information for the GoMarconi Keystore and MarconiNode Keystores
func CreateAccount ¶
func CreateAccount(password string) (*MarconiAccount, error)
Create a new account, encrypted with password
func GetAccountForAddress ¶
func GetAccountForAddress(address string) (*MarconiAccount, error)
Returns the MarconiAccount associated with the provided address.
func LoadAccount ¶
func LoadAccount(filename string) (*MarconiAccount, error)
Load a Marconi account from a specific Marconi account file
func NewAccount ¶
func NewAccount(password string) (*MarconiAccount, error)
Generates a new Marconi account that will be encrypted with the given password
func (*MarconiAccount) ExportGoMarconiKeystore ¶
func (m *MarconiAccount) ExportGoMarconiKeystore(path string) error
func (*MarconiAccount) ExportMarconiKeys ¶
func (m *MarconiAccount) ExportMarconiKeys(password string) error
Exports MarconiKeys stored in the account to mpkey files in the keystore directory
func (*MarconiAccount) GenerateMarconiKey ¶
func (m *MarconiAccount) GenerateMarconiKey(password string) (*EncryptedMarconiKeyJSON, error)
Generates a new MarconiKey and adds it to the account
func (*MarconiAccount) GetGoMarconiKey ¶
func (m *MarconiAccount) GetGoMarconiKey(password string) (*keystore.Key, error)
Returns the GoMarconi key stored in the account
func (*MarconiAccount) UseMarconiKey ¶
func (m *MarconiAccount) UseMarconiKey(mpkeyId string, password string) error
type MpkeyListItem ¶
func GetMPKeyHashesForAddress ¶
func GetMPKeyHashesForAddress(address string) ([]MpkeyListItem, error)