identity

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package identity stores the ECDSA P2P key and the BLS12-381 DV consensus key.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadOrCreatePrivKey added in v0.1.1

func LoadOrCreatePrivKey(dataDir string) (*ecdsa.PrivateKey, error)

Types

type ConsensusKey

type ConsensusKey struct {
	PrivKey kyber.Scalar
	PubKey  *bls12381.KyberG1
}

ConsensusKey wraps a BLS12-381 keypair.

type ConsensusStore

type ConsensusStore struct {
	KeystorePath string
	PasswordPath string
}

ConsensusStore stores a single DVC consensus key using a keystore and password file.

func (ConsensusStore) Create

func (s ConsensusStore) Create() (*ConsensusKey, error)

Create generates a new key and saves the new node identity.

TODO Make sure the created key can't ever be used for validators.

func (ConsensusStore) Get

func (s ConsensusStore) Get() (*ConsensusKey, error)

Get retrieves the existing node identity or creates a new one.

func (ConsensusStore) Load

func (s ConsensusStore) Load() (*ConsensusKey, error)

Load reads the existing node identity.

func (ConsensusStore) Password

func (s ConsensusStore) Password() (password string, err error)

Password reads the node password or creates a new random password if none exists.

Jump to

Keyboard shortcuts

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