tlssupport

package
v0.0.0-...-dae542e Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateHostRandom

func CreateHostRandom(
	hostSeq int,
	ip string,
	seeds map[peer.ID]ma.Multiaddr,
	logger api.Logger) (host.Host, peer.ID, ma.Multiaddr, error)

CreateHostRandom create a host instance with random crypto. This method only for testing.

func CreateHostWithCrypto

func CreateHostWithCrypto(
	hostSeq int,
	ip string,
	privateKey crypto.PrivateKey,
	seeds map[peer.ID]ma.Multiaddr,
	logger api.Logger) (host.Host, peer.ID, ma.Multiaddr, error)

CreateHostWithCrypto create a host instance with quic network type and simple config.

func MakeTlsConfigAndLoadPeerIdFuncWithPrivateKey

func MakeTlsConfigAndLoadPeerIdFuncWithPrivateKey(
	privateKey crypto.PrivateKey) (*cmTls.Config, types.LoadPeerIdFromCMTlsCertFunc, error)

MakeTlsConfigAndLoadPeerIdFuncWithPrivateKey create a tls config and load peer id function for the host config with private key given.

func PeerIdFunction

func PeerIdFunction() func(certificates []*cmx509.Certificate) (peer.ID, error)

PeerIdFunction is a function can load peer.ID from certificates got when tls handshaking.

func PrivateKeyToCertificate

func PrivateKeyToCertificate(privateKey crypto.PrivateKey) (*cmTls.Certificate, error)

PrivateKeyToCertificate create a certificate simply with a private key.

func UseGMTls

func UseGMTls(tlsCertBytes []byte) (bool, error)

UseGMTls return true if it is a tls certificate with GM crypto.

Types

This section is empty.

Jump to

Keyboard shortcuts

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