ca

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 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 added in v0.3.8

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 added in v0.3.8

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 added in v0.3.8

func (u *LetsEncryptUser) GetEmail() string

GetEmail will return the Users Email

func (*LetsEncryptUser) GetPrivateKey added in v0.3.8

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

GetPrivateKey will return the Private Key

func (*LetsEncryptUser) GetRegistration added in v0.3.8

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

Get Registration will return the Registration

func (*LetsEncryptUser) RequestCertificate added in v0.3.8

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

Jump to

Keyboard shortcuts

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