certutils

package
v0.0.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	OperatorCA = iota + 1
	ListenerCA
	ImplantCA
	RootCA
)
View Source
const (
	// RSAKey - Namespace for RSA keys
	RSAKey            = "rsa"
	RootName          = "Root"
	ListenerNamespace = "listener" // Listener servers

)

Variables

This section is empty.

Functions

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 GenerateServerCert

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

func GenerateTlsCert

func GenerateTlsCert(name, listenerID string) (string, string, 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 ParseCertificateAuthority

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

func RemoveCertificate

func RemoveCertificate(caType int, keyType string, commonName string) error

RemoveCertificate - Remove a certificate from the cert store

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 WrapToTlsConfig

func WrapToTlsConfig(config *configs.CertConfig) (*tls.Config, error)

func WrapWithTls

func WrapWithTls(lsn net.Listener, config *configs.CertConfig) (net.Listener, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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