cert

package
v0.4.41 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseCertificate

func ParseCertificate(certPEM, keyPEM []byte, password ...string) (tls.Certificate, error)

ParseCertificate 解析 PEM 证书文件

func ParseCertificateFile

func ParseCertificateFile(certFile, keyFile string, password ...string) (tls.Certificate, error)

func PoolFromPem

func PoolFromPem(pem []byte) (pool *x509.CertPool, ok bool)

func PoolFromPemFile

func PoolFromPemFile(pemFile string) (*x509.CertPool, error)

Types

type ClientTLSConfigOptions added in v0.4.31

type ClientTLSConfigOptions struct {
	CaPem             []byte
	CaFilePath        string
	ClientCertPem     []byte
	ClientCertFile    string
	ClientKeyPem      []byte
	ClientKeyFile     string
	ClientKeyPassword string
	ServerName        string // override default server name verification
	Insecure          bool
}

func (*ClientTLSConfigOptions) TLSConfig added in v0.4.31

func (o *ClientTLSConfigOptions) TLSConfig() (*tls.Config, error)

func (*ClientTLSConfigOptions) WithCA added in v0.4.31

func (o *ClientTLSConfigOptions) WithCA(caFilePath string) *ClientTLSConfigOptions

func (*ClientTLSConfigOptions) WithCAPem added in v0.4.31

func (o *ClientTLSConfigOptions) WithCAPem(pem []byte) *ClientTLSConfigOptions

func (*ClientTLSConfigOptions) WithClientCertificate added in v0.4.31

func (o *ClientTLSConfigOptions) WithClientCertificate(clientCertFile string, clientKeyFile string) *ClientTLSConfigOptions

func (*ClientTLSConfigOptions) WithClientCertificatePem added in v0.4.31

func (o *ClientTLSConfigOptions) WithClientCertificatePem(clientCertPem, clientKeyPem []byte) *ClientTLSConfigOptions

func (*ClientTLSConfigOptions) WithClientKeyPassword added in v0.4.31

func (o *ClientTLSConfigOptions) WithClientKeyPassword(password string) *ClientTLSConfigOptions

func (*ClientTLSConfigOptions) WithInsecure added in v0.4.31

func (o *ClientTLSConfigOptions) WithInsecure(insecure bool) *ClientTLSConfigOptions

func (*ClientTLSConfigOptions) WithServerName added in v0.4.32

func (o *ClientTLSConfigOptions) WithServerName(serverName string) *ClientTLSConfigOptions

type ServerTLSConfigOptions added in v0.4.31

type ServerTLSConfigOptions struct {
	ServerCertPem     []byte
	ServerCertFile    string
	ServerKeyPem      []byte
	ServerKeyFile     string
	ServerKeyPassword string
	ClientAuth        tls.ClientAuthType // for client auth
	CaPem             []byte             // for client auth
	CaFilePath        string             // for client auth
}

func (*ServerTLSConfigOptions) TLSConfig added in v0.4.31

func (o *ServerTLSConfigOptions) TLSConfig() (*tls.Config, error)

func (*ServerTLSConfigOptions) WithCA added in v0.4.31

func (o *ServerTLSConfigOptions) WithCA(caFilePath string) *ServerTLSConfigOptions

func (*ServerTLSConfigOptions) WithCAPem added in v0.4.31

func (o *ServerTLSConfigOptions) WithCAPem(pem []byte) *ServerTLSConfigOptions

func (*ServerTLSConfigOptions) WithClientAuth added in v0.4.31

func (*ServerTLSConfigOptions) WithServerCertificate added in v0.4.31

func (o *ServerTLSConfigOptions) WithServerCertificate(serverCertFile string, serverKeyFile string) *ServerTLSConfigOptions

func (*ServerTLSConfigOptions) WithServerCertificatePem added in v0.4.31

func (o *ServerTLSConfigOptions) WithServerCertificatePem(serverCertPem, serverKeyPem []byte) *ServerTLSConfigOptions

func (*ServerTLSConfigOptions) WithServerKeyPassword added in v0.4.31

func (o *ServerTLSConfigOptions) WithServerKeyPassword(password string) *ServerTLSConfigOptions

type TLSConfigOptions deprecated

type TLSConfigOptions = ClientTLSConfigOptions

TLSConfigOptions

Deprecated: use ClientTLSConfigOptions instead

Jump to

Keyboard shortcuts

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