certdb

package
v0.0.0-...-e0642ab Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCertsToDb

func AddCertsToDb(certificates *certificate.Resource, domain string, email string) error

AddCertsToDb uploads certs as strings to local MySql db

func GenerateFreeSSLCerts

func GenerateFreeSSLCerts(domain string, email string) *certificate.Resource

GenerateFreeSSLCerts requests/generate Cert and uploads it to db

func OpenDb

func OpenDb() *sql.DB

OpenDb return open DB

func RemoveCertFromDb

func RemoveCertFromDb(domain string) error

RemoveCertFromDb deletes row from db table based of primary key domain

func RemoveExpiredCerts

func RemoveExpiredCerts()

RemoveExpiredCerts removes expired certs from the db

func RemoveRevokedCerts

func RemoveRevokedCerts()

RemoveRevokedCerts removes certs that were revoked by the CA

func UpdateCertsInDb

func UpdateCertsInDb(certificates *certificate.Resource, domain string) error

UpdateCertsInDb updates the a domains certs in the db (bc the original cert is expired)

func UpdateExpiringCerts

func UpdateExpiringCerts()

UpdateExpiringCerts gets all rows in DB where cert is almost expiring, and calls UpdateCertsInDb to replace expiring certs with freshly generated ones

Types

type Certificate

type Certificate struct {
	ClientCert string `json:"clientCert"`
	IssuerCert string `json:"issuerCert"`
}

func GetCertFromDb

func GetCertFromDb(domain string) (Certificate, error)

GetCertFromDb gets cert from db from domain primary key

type MyUser

type MyUser struct {
	Email        string
	Registration *registration.Resource
	// contains filtered or unexported fields
}

func (*MyUser) GetEmail

func (u *MyUser) GetEmail() string

func (*MyUser) GetPrivateKey

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

func (MyUser) GetRegistration

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

Jump to

Keyboard shortcuts

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