Documentation ¶
Index ¶
- type BlockchainKeystore
- type ExportUserReply
- type ImportUserArgs
- type KeyValuePair
- type Keystore
- func (ks *Keystore) AddUser(username, password string) error
- func (ks *Keystore) CreateHandler() (*common.HTTPHandler, error)
- func (ks *Keystore) CreateUser(_ *http.Request, args *api.UserPass, reply *api.SuccessResponse) error
- func (ks *Keystore) DeleteUser(_ *http.Request, args *api.UserPass, reply *api.SuccessResponse) error
- func (ks *Keystore) ExportUser(_ *http.Request, args *api.UserPass, reply *ExportUserReply) error
- func (ks *Keystore) GetDatabase(bID ids.ID, username, password string) (database.Database, error)
- func (ks *Keystore) ImportUser(r *http.Request, args *ImportUserArgs, reply *api.SuccessResponse) error
- func (ks *Keystore) Initialize(log logging.Logger, db database.Database)
- func (ks *Keystore) ListUsers(_ *http.Request, args *struct{}, reply *ListUsersReply) error
- func (ks *Keystore) NewBlockchainKeyStore(blockchainID ids.ID) *BlockchainKeystore
- type ListUsersReply
- type User
- type UserDB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockchainKeystore ¶
type BlockchainKeystore struct {
// contains filtered or unexported fields
}
BlockchainKeystore ...
func (*BlockchainKeystore) GetDatabase ¶
func (bks *BlockchainKeystore) GetDatabase(username, password string) (database.Database, error)
GetDatabase ...
type ExportUserReply ¶
type ExportUserReply struct {
User formatting.CB58 `json:"user"`
}
ExportUserReply is the reply from ExportUser
type ImportUserArgs ¶
type ImportUserArgs struct { api.UserPass User formatting.CB58 `json:"user"` }
ImportUserArgs are arguments for ImportUser
type KeyValuePair ¶
KeyValuePair ...
type Keystore ¶
type Keystore struct {
// contains filtered or unexported fields
}
Keystore is the RPC interface for keystore management
func CreateTestKeystore ¶ added in v0.5.7
func CreateTestKeystore() *Keystore
CreateTestKeystore returns a new keystore that can be utilized for testing
func (*Keystore) AddUser ¶ added in v0.5.7
AddUser attempts to register this username and password as a new user of the keystore.
func (*Keystore) CreateHandler ¶
func (ks *Keystore) CreateHandler() (*common.HTTPHandler, error)
CreateHandler returns a new service object that can send requests to thisAPI.
func (*Keystore) CreateUser ¶
func (ks *Keystore) CreateUser(_ *http.Request, args *api.UserPass, reply *api.SuccessResponse) error
CreateUser creates an empty user with the provided username and password
func (*Keystore) DeleteUser ¶ added in v0.5.0
func (ks *Keystore) DeleteUser(_ *http.Request, args *api.UserPass, reply *api.SuccessResponse) error
DeleteUser deletes user with the provided username and password.
func (*Keystore) ExportUser ¶
ExportUser exports a serialized encoding of a user's information complete with encrypted database values
func (*Keystore) GetDatabase ¶
GetDatabase ...
func (*Keystore) ImportUser ¶
func (ks *Keystore) ImportUser(r *http.Request, args *ImportUserArgs, reply *api.SuccessResponse) error
ImportUser imports a serialized encoding of a user's information complete with encrypted database values, integrity checks the password, and adds it to the database
func (*Keystore) Initialize ¶
Initialize the keystore
func (*Keystore) ListUsers ¶
func (ks *Keystore) ListUsers(_ *http.Request, args *struct{}, reply *ListUsersReply) error
ListUsers lists all the registered usernames
func (*Keystore) NewBlockchainKeyStore ¶
func (ks *Keystore) NewBlockchainKeyStore(blockchainID ids.ID) *BlockchainKeystore
NewBlockchainKeyStore ...
type ListUsersReply ¶
type ListUsersReply struct {
Users []string `json:"users"`
}
ListUsersReply is the reply from ListUsers
type User ¶
type User struct { Password [32]byte `serialize:"true"` // The salted, hashed password Salt [16]byte `serialize:"true"` // The salt }
User describes a user of the keystore
type UserDB ¶
type UserDB struct { User `serialize:"true"` Data []KeyValuePair `serialize:"true"` }
UserDB describes the full content of a user