cert

package
v0.0.0-...-7cb1dad Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadCert

func LoadCert(keyFile string, certFile string, bundleFile string) (*tls.Config, error)

LoadCert loads and returns a configured tls.Config using the provided ControllerConfig for TLS settings. It reads the CA bundle, certificate, and key files specified in the config. If any file is missing, it returns an error. The function also handles loading X.509 key pairs and appending CA certificates to a new certificate pool. Note: InsecureSkipVerify is set to true regardless of the config setting.

func ShowCertificate

func ShowCertificate(certFile string) (string, error)

func ShowCertificateDetail

func ShowCertificateDetail(cert *x509.Certificate) string

func ShowCertificatePool

func ShowCertificatePool(certPool *x509.CertPool) string

func ShowCertificatePoolFromFile

func ShowCertificatePoolFromFile(certPoolFile string) (string, error)

Types

type CertPoolWithAccess

type CertPoolWithAccess struct {
	// contains filtered or unexported fields
}

CertPoolWithAccess is a wrapper over x509.CertPool

func NewCertPoolWithAccess

func NewCertPoolWithAccess() *CertPoolWithAccess

NewCertPoolWithAccess creates a new CertPoolWithAccess

func (*CertPoolWithAccess) AddCert

func (c *CertPoolWithAccess) AddCert(certPEM []byte) error

AddCert adds a certificate to the pool and stores it for later access

func (*CertPoolWithAccess) ListCerts

func (c *CertPoolWithAccess) ListCerts() string

ListCerts prints the subjects of all certificates in the pool

Jump to

Keyboard shortcuts

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