ca

package
v0.0.0-...-2e4306c Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRootCA

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

GenerateRootCA generates a self-signed Root CA cert and key

func SaveCA

func SaveCA(cert *x509.Certificate, key *rsa.PrivateKey, certPath, keyPath string) error

SaveCA saves the CA cert and key to files

Types

type CA

type CA struct {
	Cert *x509.Certificate
	Key  *rsa.PrivateKey
}

CA represents a Certificate Authority

func LoadCA

func LoadCA(certPath, keyPath string) (*CA, error)

LoadCA loads a CA from files

func NewCA

func NewCA(caCertPath, caKeyPath string) (*CA, error)

NewCA creates a new Root CA or loads an existing one

func (*CA) SignCertificate

func (c *CA) SignCertificate(host string) (*x509.Certificate, *rsa.PrivateKey, error)

SignCertificate signs a new certificate for a specific host using the Root CA

Jump to

Keyboard shortcuts

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