Documentation ¶
Index ¶
- Variables
- func Ed25519PrivateKeyToLibp2pPrivateKey(privKey ed25519.PrivateKey) (libp2pcrypto.PrivKey, error)
- func Libp2pPrivateKeyToEd25519PrivateKey(libp2pPrivKey libp2pcrypto.PrivKey) (ed25519.PrivateKey, error)
- func LoadOrCreateIdentityPrivateKey(privKeyFilePath string, identityPrivKey string) (libp2pcrypto.PrivKey, bool, error)
- func ParseLibp2pEd25519PrivateKeyFromString(identityPrivKey string) (libp2pcrypto.PrivKey, error)
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.
Click to show internal directories.
Click to hide internal directories.