cert

package
v0.4.24 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 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 TLSConfigOptions

type TLSConfigOptions struct {
	CaPem             []byte
	CaFilePath        string
	ClientCertPem     []byte
	ClientCertFile    string
	ClientKeyPem      []byte
	ClientKeyFile     string
	ClientKeyPassword string
	Insecure          bool
}

func (*TLSConfigOptions) TLSConfig

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

func (*TLSConfigOptions) WithCA

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

func (*TLSConfigOptions) WithCAPem added in v0.4.21

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

func (*TLSConfigOptions) WithClientCertificate

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

func (*TLSConfigOptions) WithClientCertificatePem added in v0.4.21

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

func (*TLSConfigOptions) WithClientKeyPassword

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

func (*TLSConfigOptions) WithInsecure

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

Jump to

Keyboard shortcuts

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