certs

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckUserCertAvailable added in v2.2.0

func CheckUserCertAvailable() (bool, bool)

func GetACMEFileNames

func GetACMEFileNames(domainName string, dirName string) (string, string, string, string)

func PrepareCerts

func PrepareCerts() (chan struct{}, chan struct{}, error)

func SetDefaultDomain added in v2.2.0

func SetDefaultDomain(https, wss bool) (bool, error)

func VerifyCertificate

func VerifyCertificate(certPath, keyPath, domain string) (bool, error)

func VerifyLocalCertificate

func VerifyLocalCertificate(certPath string, keyPath string, domain string) (bool, error)

func VerifyOCSP

func VerifyOCSP(bundle []byte) (bool, error)

Types

type CertManager added in v2.2.0

type CertManager struct {
	User       *User
	LegoConfig *lego.Config
	LegoClient *lego.Client
	Resource   *certificate.Resource
}

func NewCertManager

func NewCertManager() (*CertManager, error)

func (*CertManager) NeedObtain added in v2.2.0

func (cm *CertManager) NeedObtain() bool

func (*CertManager) NeedRenew added in v2.2.0

func (cm *CertManager) NeedRenew() bool

func (*CertManager) ObtainNewCert added in v2.2.0

func (cm *CertManager) ObtainNewCert() (*certificate.Resource, error)

func (*CertManager) RenewCert added in v2.2.0

func (cm *CertManager) RenewCert() (*certificate.Resource, error)

type User

type User struct {
	Domain       string
	Email        string
	Registration *registration.Resource
	Key          *rsa.PrivateKey
}

You'll need a User or account type that implements acme.User

func GetUser

func GetUser() (*User, error)

func (*User) GetEmail

func (u *User) GetEmail() string

func (*User) GetPrivateKey

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

func (User) GetRegistration

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

func (*User) SaveToDisk

func (u *User) SaveToDisk() error

Jump to

Keyboard shortcuts

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