ca

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package ca will handle the creation of certificates for TSL encrypted communication Credits: Shane Utt https://shaneutt.com/blog/golang-ca-and-signed-cert-go/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLECertificateAndKey

func GetLECertificateAndKey(email string, domains []string, httpPort string, tlsPort string)

func ParseAndSum

func ParseAndSum(cert string) (sha256s, sha1s string, err error)

ParseAndSum will take the user provided cert and return the sha256 and sha1 sum

func Setup

func Setup() (serverTLSConf *tls.Config, sha256s, sha1s string, err error)

Setup will deliver a fully initialized CA and server cert

func Sum

func Sum(cert []byte) (sha256s, sha1s string)

Sum will give the sha256 and sha1 sum of the certificate

Types

type LetsEncryptUser

type LetsEncryptUser struct {
	Email        string
	Registration *registration.Resource
	Key          crypto.PrivateKey
	HTTPPort     string
	TLSPort      string
	Domains      []string
	Config       *lego.Config
	Client       *lego.Client
}

LetsEncryptUser is the struct of all information needed to rollout a lets encrypt certificate

func (*LetsEncryptUser) GetEmail

func (u *LetsEncryptUser) GetEmail() string

GetEmail will return the Users Email

func (*LetsEncryptUser) GetPrivateKey

func (u *LetsEncryptUser) GetPrivateKey() crypto.PrivateKey

GetPrivateKey will return the Private Key

func (*LetsEncryptUser) GetRegistration

func (u *LetsEncryptUser) GetRegistration() *registration.Resource

Get Registration will return the Registration

func (*LetsEncryptUser) RequestCertificate

func (u *LetsEncryptUser) RequestCertificate() ([]byte, []byte)

Jump to

Keyboard shortcuts

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