eos

package
v0.0.0-...-18a0530 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package eos

Package eos

Package eos

Package eos

Package eos

Package eos

Package eos

Index

Constants

View Source
const (
	PrivateKey  = "private.key"     // 私钥
	Certificate = "certificate.pem" // 证书
	CA          = "ca.crt"          // CA
	CSR         = "csr"             // 全量csr
)

Variables

This section is empty.

Functions

func GetLogger

func GetLogger() *log.Logger

func NewClient

func NewClient(account *Account) (*lego.Client, error)

NewClient returns a new Lets Encrypt client

func ObtainDomains

func ObtainDomains(c *lego.Client, domains []string) (*certificate.Resource, error)

func RegAccount

func RegAccount(c *lego.Client) (*registration.Resource, error)

func RegProvider

func RegProvider(c *lego.Client) error

RegProvider 注册

func SaveCert

func SaveCert(cert *certificate.Resource) error

SaveCert 保存cert文件 默认会保存到$CertRoot下

Types

type Account

type Account struct {
	Email        string                 `json:"email"`
	Registration *registration.Resource `json:"registrations"`
	KeyType      KeyType                `json:"keyType"`
	// contains filtered or unexported fields
}

func NewAccount

func NewAccount(email string, keyType KeyType) (*Account, error)

NewAccount 创建账户

func (*Account) AddRegistration

func (a *Account) AddRegistration(reg *registration.Resource)

func (*Account) GetEmail

func (a *Account) GetEmail() string

GetEmail returns the email address for the account

func (*Account) GetPrivateKey

func (a *Account) GetPrivateKey() crypto.PrivateKey

GetPrivateKey returns the private RSA account key.

func (*Account) GetRegistration

func (a *Account) GetRegistration() *registration.Resource

GetRegistration returns the server registration

func (*Account) Save

func (a *Account) Save() error

Save the account to disk

type ApiVersion

type ApiVersion string
const (
	Production ApiVersion = "Production"
	Sandbox    ApiVersion = "Sandbox"
)

type EosConfig

type EosConfig struct {
	Email     string
	Domain    []string
	CertRoot  string
	Challenge string // 存储质询文件路径
	Renew     string // 刷新间隔 默认3个月
	Disable   bool
}

func GetConfig

func GetConfig() EosConfig

type KeyType

type KeyType string
const (
	RSA2048 KeyType = "RSA-2048"
	RSA4096 KeyType = "RSA-4096"
	RSA8192 KeyType = "RSA-8192"
	EC256   KeyType = "ECDSA-256"
	EC384   KeyType = "ECDSA-384"
)

Jump to

Keyboard shortcuts

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