keystore

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2020 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

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

type KeyValuePair struct {
	Key   []byte `serialize:"true"`
	Value []byte `serialize:"true"`
}

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

func (ks *Keystore) AddUser(username, password string) error

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

func (ks *Keystore) ExportUser(_ *http.Request, args *api.UserPass, reply *ExportUserReply) error

ExportUser exports a serialized encoding of a user's information complete with encrypted database values

func (*Keystore) GetDatabase

func (ks *Keystore) GetDatabase(bID ids.ID, username, password string) (database.Database, error)

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

func (ks *Keystore) Initialize(log logging.Logger, db database.Database)

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

func (*User) CheckPassword

func (usr *User) CheckPassword(password string) bool

CheckPassword ...

func (*User) Initialize

func (usr *User) Initialize(password string) error

Initialize ...

type UserDB

type UserDB struct {
	User `serialize:"true"`
	Data []KeyValuePair `serialize:"true"`
}

UserDB describes the full content of a user

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL