ca

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTrustCrtsDirEmpty = errors.New("trust certs dir is empty")
)

Functions

func GetTLSConfig

func GetTLSConfig(certPemPath, certKeyPath string, caPaths, caCerts []string,
	encCertPemPath, encCertKeyPath string) (*cmtls.Config, error)

func NewTLSListener

func NewTLSListener(inner net.Listener, config *cmtls.Config) net.Listener

Types

type CAClient

type CAClient struct {
	ServerName string
	CaPaths    []string
	CaCerts    []string
	CertFile   string
	KeyFile    string
	CertBytes  []byte
	KeyBytes   []byte
	Logger     log.LoggerInterface
	//for gmtls1.1
	EncCertFile  string
	EncKeyFile   string
	EncCertBytes []byte
	EncKeyBytes  []byte
}

func (*CAClient) GetCredentialsByCA

func (c *CAClient) GetCredentialsByCA() (*credentials.TransportCredentials, error)

type CAServer

type CAServer struct {
	CaPaths  []string
	CaCerts  []string
	CertFile string
	KeyFile  string
	Logger   log.LoggerInterface
}

func (*CAServer) GetCredentialsByCA

func (s *CAServer) GetCredentialsByCA(checkClientAuth bool, customVerify CustomVerify) (
	*credentials.TransportCredentials, error)

type CustomVerify

type CustomVerify struct {
	VerifyPeerCertificate   func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error
	GMVerifyPeerCertificate func(rawCerts [][]byte, verifiedChains [][]*cmx509.Certificate) error
}

Jump to

Keyboard shortcuts

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