cert

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PEMBlockRSAPrivateKey = "RSA PRIVATE KEY"
	PEMBlockECPrivateKey  = "EC PRIVATE KEY"
	PEMBlockCertificate   = "CERTIFICATE"
)

Variables

This section is empty.

Functions

func CreateDevTLSCertificate

func CreateDevTLSCertificate(dns ...string) ([]byte, any, error)

CreateDevTLSCertificate creates a self-signed certificate for development. Returns certificate DER bytes and private key.

func DERBytesToPEMBlocks

func DERBytesToPEMBlocks(der []byte, priv any) ([]byte, []byte, error)

DERBytesToPEMBlocks converts certificate DER bytes and optional private key to PEM blocks. Returns certificate PEM block and private key PEM block.

func DevTLSCertificate

func DevTLSCertificate(name string, dns ...string) ([]byte, []byte, error)

DevTLSCertificate loads or generates new TLS certificate for development.

func LoadTLSCertificate

func LoadTLSCertificate(path string) ([]byte, []byte, error)

LoadTLSCertificate loads a PEM-encoded certificate and private key from the specified file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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