certs

package
v1.15.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCA

func GenerateCA() ([]byte, *rsa.PrivateKey, error)

GenerateCA generates a self-signed CA root certificate and private key The certificate is valid for 10 years.

func GenerateCert

func GenerateCert(ca []byte,
	commonName string,
	extraSANs []string,
	caPrivateKey *rsa.PrivateKey,
) ([]byte, *rsa.PrivateKey, error)

GenerateCert generates a certificate and private key signed by the provided CA. The certificate is valid for 10 years.

func PEMEncodeCertificate

func PEMEncodeCertificate(certificate []byte) ([]byte, error)

PEMEncodeCertificate encodes a certificate to PEM format.

func PEMEncodePrivateKey

func PEMEncodePrivateKey(privateKey *rsa.PrivateKey) ([]byte, error)

PEMEncodePrivateKey encodes a private key to PEM format.

Types

This section is empty.

Jump to

Keyboard shortcuts

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