p2p

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: Apache-2.0, BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPrivKeyInvalid = errors.New("invalid private key")
	ErrNoPrivKeyFound = errors.New("no private key found")
)

Functions

func Ed25519PrivateKeyToLibp2pPrivateKey

func Ed25519PrivateKeyToLibp2pPrivateKey(privKey ed25519.PrivateKey) (libp2pcrypto.PrivKey, error)

func Libp2pPrivateKeyToEd25519PrivateKey

func Libp2pPrivateKeyToEd25519PrivateKey(libp2pPrivKey libp2pcrypto.PrivKey) (ed25519.PrivateKey, error)

func LoadOrCreateIdentityPrivateKey

func LoadOrCreateIdentityPrivateKey(privKeyFilePath string, identityPrivKey string) (libp2pcrypto.PrivKey, bool, error)

LoadOrCreateIdentityPrivateKey loads an existing Ed25519 based identity private key or creates a new one and stores it as a PEM file in the p2p store folder.

func ParseLibp2pEd25519PrivateKeyFromString

func ParseLibp2pEd25519PrivateKeyFromString(identityPrivKey string) (libp2pcrypto.PrivKey, error)

ParseLibp2pEd25519PrivateKeyFromString parses an Ed25519 private key from a hex encoded string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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