safe

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCertDates

func CheckCertDates(certFile string) error

func FileExists

func FileExists(name string) bool

FileExists checks to see if a file exists

func GetX509CertificateFromPEM

func GetX509CertificateFromPEM(cert []byte) (*x509.Certificate, error)

GetX509CertificateFromPEM get an X509 certificate from bytes in PEM format

func LoadPEMCertPool

func LoadPEMCertPool(certFiles []string) (*x509.CertPool, error)

LoadPEMCertPool loads a pool of PEM certificates from list of files

func LoadX509KeyPair

func LoadX509KeyPair(certFile, keyFile string) (*tls.Certificate, error)

LoadX509KeyPair reads and parses a public/private key pair from a pair of files. The files must contain PEM encoded data. The certificate file may contain intermediate certificates following the leaf certificate to form a certificate chain. On successful return, Certificate.Leaf will be nil because the parsed form of the certificate is not retained.

func NewTLSClient

func NewTLSClient(certFile string, keyFile string, certFiles []string) (*http.Client, error)

func NewTLSClientConfig

func NewTLSClientConfig(certFile string, keyFile string, certFiles []string) (*tls.Config, error)

func NewTLSServerListener

func NewTLSServerListener(endpoint string, certFile string, keyFile string, Type string, certFiles []string) (net.Listener, error)

func X509KeyPair

func X509KeyPair(certPEMBlock, keyPEMBlock []byte) (*tls.Certificate, error)

X509KeyPair parses a public/private key pair from a pair of PEM encoded data. On successful return, Certificate.Leaf will be nil because the parsed form of the certificate is not retained.

Types

This section is empty.

Jump to

Keyboard shortcuts

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