certgen

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: MIT Imports: 14 Imported by: 0

README

CertGen

Some certificate generation utilities

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TlsLeaf

func TlsLeaf(cert *tls.Certificate) *x509.Certificate

Types

type CertGen

type CertGen struct {
	// contains filtered or unexported fields
}

func LoadCertGen

func LoadCertGen(certBytes, keyBytes []byte) (*CertGen, error)

func MakeCaTls

func MakeCaTls(bits int, name pkix.Name, serialNumber *big.Int, future Future) (*CertGen, error)

MakeCaTls generates a CA TLS certificate

func MakeClientTls

func MakeClientTls(ca *CertGen, bits int, name pkix.Name, serialNumber *big.Int, future Future) (*CertGen, error)

MakeClientTls generates a client TLS certificate using a CA to sign it If ca is nil then the client will sign its own certificate

func MakeServerTls

func MakeServerTls(ca *CertGen, bits int, name pkix.Name, serialNumber *big.Int, future Future, dnsNames []string, ipAddresses []net.IP) (*CertGen, error)

MakeServerTls generates a server TLS certificate using a CA to sign it If ca is nil then the server will sign its own certificate dnsNames and ipAddresses can be nil if they are not required on the certificate

func (*CertGen) GetCertPem

func (ca *CertGen) GetCertPem() []byte

func (*CertGen) GetKeyPem

func (ca *CertGen) GetKeyPem() []byte

func (*CertGen) GetTlsLeaf

func (ca *CertGen) GetTlsLeaf() tls.Certificate

func (*CertGen) SaveFiles

func (ca *CertGen) SaveFiles(caCert, caKey io.Writer) error

type Future

type Future func(now time.Time) time.Time

Future is a function for converting the current time to a future time

Jump to

Keyboard shortcuts

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