certificate

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MulanPSL-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(ctx context.Context) error

Init 初始化证书管理器

Types

type Certificate added in v1.0.1

type Certificate struct {
	// contains filtered or unexported fields
}

func (*Certificate) GetCertificateContent added in v1.0.1

func (c *Certificate) GetCertificateContent() []byte

func (*Certificate) GetCertificateFilePath added in v1.0.1

func (c *Certificate) GetCertificateFilePath() string

func (*Certificate) GetCsrContent added in v1.0.1

func (c *Certificate) GetCsrContent() []byte

func (*Certificate) GetCsrFilePath added in v1.0.1

func (c *Certificate) GetCsrFilePath() string

func (*Certificate) GetExpireTime added in v1.0.1

func (c *Certificate) GetExpireTime() time.Time

func (*Certificate) GetIssueCertificate added in v1.0.1

func (c *Certificate) GetIssueCertificate() []byte

func (*Certificate) GetIssueCertificateFilePath added in v1.0.1

func (c *Certificate) GetIssueCertificateFilePath() string

func (*Certificate) GetPrivateKeyContent added in v1.0.1

func (c *Certificate) GetPrivateKeyContent() []byte

func (*Certificate) GetPrivateKeyFilePath added in v1.0.1

func (c *Certificate) GetPrivateKeyFilePath() string

type Manager added in v1.0.1

type Manager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func GetManager added in v1.0.1

func GetManager() *Manager

GetManager 获取证书管理器

func (*Manager) CheckExists added in v1.0.1

func (m *Manager) CheckExists(host string) bool

CheckExists 检查域名证书是否存在

func (*Manager) GetCertificate added in v1.0.1

func (m *Manager) GetCertificate(host string) (*Certificate, error)

GetCertificate 获取域名的证书

func (*Manager) GetMustCertificate added in v1.0.1

func (m *Manager) GetMustCertificate(host string) *Certificate

GetMustCertificate 获取域名的证书,该方法假定一定成功

func (*Manager) IssueNew added in v1.0.1

func (m *Manager) IssueNew(host, email string) (*Certificate, error)

IssueNew 申请新的证书 申请证书需要监听80与443端口,申请证书前需要关闭所有web服务,以免续期失败

func (*Manager) Renew added in v1.0.1

func (m *Manager) Renew(host, email string) error

Renew 续期证书 续期证书需要监听80与443端口,续期前需要关闭所有web服务器,以免续期失败

func (*Manager) RenewLoop added in v1.0.1

func (m *Manager) RenewLoop()

RenewLoop 证书续期循环 该方法必须放在goroutine中运行 该方法在凌晨4点进行证书检查,并续期所有有效期在10天以内的证书

Jump to

Keyboard shortcuts

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