session

package
v0.0.0-...-76c1feb Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	Initialized bool

	Kill context.CancelFunc
	// contains filtered or unexported fields
}

Manager allows users to initialize wallets by knowing their passwords, and stores the initialized wallets in memory where the user can access them by an ephemeral wallet handle token

func MakeManager

func MakeManager(cfg config.KMDConfig) *Manager

MakeManager initializes and returns a *Manager using the kmd global configuration

func (*Manager) AuthWithWalletHandleToken

func (sm *Manager) AuthWithWalletHandleToken(walletHandleToken []byte) (wallet.Wallet, int64, error)

AuthWithWalletHandleToken parses an untrusted walletHandle []byte and returns the Wallet it corresponds to + seconds until expiration if and only if the walletHandle was valid.

func (*Manager) InitWalletHandle

func (sm *Manager) InitWalletHandle(w wallet.Wallet, pw []byte) ([]byte, error)

InitWalletHandle attempts to init the wallet using the passed password, generates a wallet handle token, and adds the session to the memory store

func (*Manager) ReleaseWalletHandle

func (sm *Manager) ReleaseWalletHandle(walletHandleToken []byte) error

ReleaseWalletHandle deletes the wallet handle if it exists

func (*Manager) RenewWalletHandleToken

func (sm *Manager) RenewWalletHandleToken(walletHandleToken []byte) (wallet.Wallet, int64, error)

RenewWalletHandleToken parses an untrusted walletHandle []byte and renews it if the secret is correct and if it hasn't already expired

Jump to

Keyboard shortcuts

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