certgen

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKeyPair

func GenerateKeyPair(rootCertCN string, notBefore, notAfter time.Time, hosts ...string) ([]byte, []byte, *ecdsa.PrivateKey, error)

GenerateKeyPair creates root CA, certificate and key with optional hosts. Certificate is valid from notBefore and expires after notAfter.

func MarshalCertToPEMString

func MarshalCertToPEMString(derBytes []byte) (string, error)

MarshalCertToPEMString encodes derBytes to a PEM format suitable for dropping into a route's TLS certificate stanza.

func MarshalPrivateKeyToPEMString

func MarshalPrivateKeyToPEMString(key *ecdsa.PrivateKey) (string, error)

MarshalPrivateKeyToPEMString converts the key to a string representation (PEM form) suitable for dropping into a route's TLS key stanza.

Types

This section is empty.

Jump to

Keyboard shortcuts

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