cert

package
v0.0.0-...-e890a9a Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package cert provides functionality for creating self-signed and signed certificates.

Index

Constants

View Source
const (
	// CertCreateSelfsigned represents the operation of creating a self-signed certificate.
	CertCreateSelfsigned = "create_cert"
	// CertCreateSigned represents the operation of creating a signed certificate.
	CertCreateSigned = "create_signed_cert"
	// StoreCert represents the operation of storing a certificate.
	StoreCert = "store_cert"
	// StoreKey represents the operation of storing a key.
	StoreKey = "store_key"
	// GetCert represents the operation of retrieving a certificate.
	GetCert = "get_cert"
	// GetKey represents the operation of retrieving a key.
	GetKey = "get_key"
)

Constants for certificate creation operations.

Variables

This section is empty.

Functions

func GenerateAndSign

func GenerateAndSign(fqdn, email string) (*tls.Config, http.Handler)

GenerateAndSign generates a new certificate for the given fully qualified domain name (fqdn) and email, and returns a TLS configuration and an HTTP handler. The function uses the autocert package to automatically access certificates from Let's Encrypt.

func GenerateSelfsigned

func GenerateSelfsigned(hostname string) ([]byte, []byte, error)

GenerateSelfsigned creates a self-signed certificate for the given hostname. It returns the certificate and private key as byte slices, or an error if any step of the generation fails.

Types

This section is empty.

Jump to

Keyboard shortcuts

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