certutils

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ACMEDirName - Name of dir to store ACME certs
	ACMEDirName  = "acme"
	ACMERootPath = "/.well-known/acme-challenge/"
)

Variables

This section is empty.

Functions

func CertificateSubjectToPkixName added in v0.1.1

func CertificateSubjectToPkixName(subject *clientpb.CertificateSubject) *pkix.Name

func GenerateClientCert

func GenerateClientCert(host, name string, port int) (*mtls.ClientConfig, error)

func GenerateListenerCert

func GenerateListenerCert(host, name string, port int) (*mtls.ClientConfig, error)

func GenerateRootCert

func GenerateRootCert() error

func GenerateSelfTLS added in v0.1.1

func GenerateSelfTLS(name string, certsSubject *clientpb.CertificateSubject) (*clientpb.TLS, error)

func GenerateServerCert

func GenerateServerCert(name string) ([]byte, []byte, error)

func GetACMEDir added in v0.1.1

func GetACMEDir() string

GetACMEDir - Dir to store ACME certs

func GetAcmeTls added in v0.1.1

func GetAcmeTls(config *clientpb.TLS) (*clientpb.TLS, error)

func GetCertificateAuthority

func GetCertificateAuthority() (*x509.Certificate, *rsa.PrivateKey, error)

GetCertificateAuthority - Get the current CA certificate

func GetCertificateAuthorityPEM

func GetCertificateAuthorityPEM(caCertPath, caKeyPath string) ([]byte, []byte, error)

GetCertificateAuthorityPEM - Get PEM encoded CA cert/key

func GetOperatorServerMTLSConfig

func GetOperatorServerMTLSConfig(host string) *tls.Config

GetOperatorServerMTLSConfig - Get the TLS config for the operator server

func GetTlsConfig added in v0.1.0

func GetTlsConfig(config *types.CertConfig) (*tls.Config, error)

func ParseCertificateAuthority

func ParseCertificateAuthority(certPEM, keyPEM []byte) (*x509.Certificate, *rsa.PrivateKey, error)

func SaveCertificateAuthority

func SaveCertificateAuthority(caType int, cert []byte, key []byte)

SaveCertificateAuthority - Save the certificate and the key to the filesystem doesn't return an error because errors are fatal. If we can't generate CAs, then we can't secure communication and we should die a horrible death.

func TlsConfig added in v0.1.1

func TlsConfig(cert tls.Certificate) *tls.Config

func WrapWithTls

func WrapWithTls(lsn net.Listener, cert *types.CertConfig) (net.Listener, error)

Types

type ACMEManager added in v0.1.1

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

func GetACMEManager added in v0.1.1

func GetACMEManager() *ACMEManager

func (*ACMEManager) GetManager added in v0.1.1

func (a *ACMEManager) GetManager() *autocert.Manager

func (*ACMEManager) RegisterDomain added in v0.1.1

func (a *ACMEManager) RegisterDomain(domain string)

Jump to

Keyboard shortcuts

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