tlssupport

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 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) (*tls.Config, types.LoadPeerIdFromTlsCertFunc, 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 []*x509.Certificate) (peer.ID, error)

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

func PeerIdFunctionGM

func PeerIdFunctionGM() func(certificates []*gmx509.Certificate) (peer.ID, error)

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

func PeerIdFunctionQuic

func PeerIdFunctionQuic() func(certificates []*qx509.Certificate) (peer.ID, error)

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

func PrivateKeyToCertificate

func PrivateKeyToCertificate(privateKey crypto.PrivateKey) (*tls.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