certs

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Cmd = &cobra.Command{
		Use:   "certs",
		Short: "Generate mTLS certificates (CA, server, client)",
		RunE:  runGenerate,
	}
)

Functions

func EncodeCertificate

func EncodeCertificate(cert *x509.Certificate) []byte

EncodeCertificate encodes a certificate to PEM format

func EncodePrivateKey

func EncodePrivateKey(key *rsa.PrivateKey) []byte

EncodePrivateKey encodes a private key to PEM format

func GenerateCA

func GenerateCA(validYears int) (*rsa.PrivateKey, *x509.Certificate, error)

GenerateCA generates a CA certificate

func GenerateClientCert

func GenerateClientCert(caKey *rsa.PrivateKey, caCert *x509.Certificate, validYears int) (*rsa.PrivateKey, *x509.Certificate, error)

GenerateClientCert generates a client certificate

func GenerateServerCert

func GenerateServerCert(caKey *rsa.PrivateKey, caCert *x509.Certificate, validYears int, dnsNames []string) (*rsa.PrivateKey, *x509.Certificate, error)

GenerateServerCert generates a server certificate with the specified DNS names

Types

This section is empty.

Jump to

Keyboard shortcuts

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