mnemonic

package
v0.0.0-...-3d164b4 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Allows to create a Store that contains a set of public a private keys derived from a mnemonic.

Important note: Not meant for production, mnemonic is exposed as a raw text.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store defines a mnemonic keyvault, written for demonstrative purposes.

func NewStore

func NewStore(
	mnemonicPhrase string,
	mnemonicPassword string,
	startIndex int,
	numKeys int) (*Store, error)

NewStore instantiates a mnemonic keyvault using a set number of keys.

func (*Store) GetPublicKeys

func (s *Store) GetPublicKeys(context.Context) ([]bls.PublicKey, error)

GetPublicKeys returns all available BLS12-381 public keys in the mnemonic keyvault.

func (*Store) GetSecretKey

func (s *Store) GetSecretKey(ctx context.Context, pubKey bls.PublicKey) (bls.SecretKey, error)

GetSecretKey returns the corresponding secret key for a BLS12-381 public key.

Jump to

Keyboard shortcuts

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