basic

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package basic provides straightforward implementation for key management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyManager

type KeyManager struct {
	// contains filtered or unexported fields
}

func NewKeyManager

func NewKeyManager(cfg *configs.Config, store keys.Store, fc flow_helpers.FlowClient) *KeyManager

NewKeyManager initiates a new key manager. It uses encryption.AESCrypter to encrypt and decrypt the keys.

func (*KeyManager) AdminAuthorizer

func (s *KeyManager) AdminAuthorizer(ctx context.Context) (keys.Authorizer, error)

func (*KeyManager) AdminProposalKey

func (s *KeyManager) AdminProposalKey(ctx context.Context) (keys.Authorizer, error)

func (*KeyManager) CheckAdminProposalKeyCount added in v0.9.0

func (s *KeyManager) CheckAdminProposalKeyCount(ctx context.Context) error

func (*KeyManager) Generate

func (s *KeyManager) Generate(ctx context.Context, keyIndex, weight int) (*flow.AccountKey, *keys.Private, error)

func (*KeyManager) GenerateDefault

func (s *KeyManager) GenerateDefault(ctx context.Context) (*flow.AccountKey, *keys.Private, error)

func (*KeyManager) InitAdminProposalKeys

func (s *KeyManager) InitAdminProposalKeys(ctx context.Context) (uint16, error)

func (*KeyManager) Load

func (s *KeyManager) Load(key keys.Storable) (keys.Private, error)

func (*KeyManager) MakeAuthorizer

func (s *KeyManager) MakeAuthorizer(ctx context.Context, address flow.Address) (keys.Authorizer, error)

func (*KeyManager) Save

func (s *KeyManager) Save(key keys.Private) (keys.Storable, error)

func (*KeyManager) UserAuthorizer

func (s *KeyManager) UserAuthorizer(ctx context.Context, address flow.Address) (keys.Authorizer, error)

Jump to

Keyboard shortcuts

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