helper

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 13 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLibp2pPeerIdWithPrivateKey

func CreateLibp2pPeerIdWithPrivateKey(privateKey crypto.PrivateKey) (string, error)

CreateLibp2pPeerIdWithPrivateKey create a peer.ID with crypto.PrivateKey.

func CreateLibp2pPeerIdWithPublicKey

func CreateLibp2pPeerIdWithPublicKey(publicKey crypto.PublicKey) (string, error)

CreateLibp2pPeerIdWithPublicKey create a peer.ID with crypto.PublicKey.

func GetLibp2pPeerIdFromCert

func GetLibp2pPeerIdFromCert(certPemBytes []byte) (string, error)

GetLibp2pPeerIdFromCert create a peer.ID with pubKey that contains in cert.

func GetLibp2pPeerIdFromCertDer

func GetLibp2pPeerIdFromCertDer(certDerBytes []byte) (string, error)

GetLibp2pPeerIdFromCertDer create a peer.ID with pubKey that contains in cert.

func GetNodeUidFromAddr

func GetNodeUidFromAddr(addr string) (string, error)

GetNodeUidFromAddr get the unique id of node from an addr. 从地址中截取出节点ID

func P2pAddressFormatVerify

func P2pAddressFormatVerify(address string) bool

P2pAddressFormatVerify verify a node address format.

func ParseGoPublicKeyToPubKey

func ParseGoPublicKeyToPubKey(publicKey goCrypto.PublicKey) (libp2pcrypto.PubKey, error)

ParseGoPublicKeyToPubKey parse a go crypto PublicKey to a libp2p crypto PubKey.

Types

This section is empty.

Directories

Path Synopsis
Package crypto implements various cryptographic utilities used by libp2p.
Package crypto implements various cryptographic utilities used by libp2p.
pb

Jump to

Keyboard shortcuts

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