certs

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertificateAuthority

type CertificateAuthority struct {
	CACert    *x509.Certificate
	CAKey     *rsa.PrivateKey
	CACertPEM []byte
	CAKeyPEM  []byte
}

CertificateAuthority manages the internal PKI for FallBCK server and agent mTLS

func LoadOrCreateCA

func LoadOrCreateCA(certPath, keyPath string) (*CertificateAuthority, error)

LoadOrCreateCA loads a CA from disk or generates a new self-signed root CA

func (*CertificateAuthority) IssueClientCert

func (ca *CertificateAuthority) IssueClientCert(commonName string, validityDays int) (*KeyPair, error)

IssueClientCert generates a client mTLS keypair signed by this CA for an agent or server

type KeyPair

type KeyPair struct {
	CertPEM []byte
	KeyPEM  []byte
}

KeyPair holds PEM-encoded certificate and private key

func (*KeyPair) WriteKeyPair

func (kp *KeyPair) WriteKeyPair(certPath, keyPath string) error

WriteKeyPair writes PEM cert and key to destination files

Jump to

Keyboard shortcuts

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