registrations

package
v0.0.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	LetsencryptSSL = "letsencrypt"
	ZeroSSL        = "zerossl"
)

Variables

This section is empty.

Functions

func UseDNSObtain

func UseDNSObtain(legoClient *lego.Client, provider challenge.Provider, domains []string, nameservers []string) (*certificate.Resource, error)

func UseHTTPObtain

func UseHTTPObtain(legoClient *lego.Client, provider challenge.Provider, domains []string) (*certificate.Resource, error)

Types

type Certificate

type Certificate struct {
	User              *User  `json:"user" xml:"user"`
	Domain            string `json:"domain" xml:"domain"`
	CertUrl           string `json:"certUrl" xml:"certUrl"`
	CertStableUrl     string `json:"certStableUrl" xml:"certStableUrl"`
	PrivateKey        string `json:"privateKey" xml:"privateKey"`
	Certificate       string `json:"certificate" xml:"certificate"`
	IssuerCertificate string `json:"issuerCertificate" xml:"issuerCertificate"`
	Csr               string `json:"csr" xml:"csr"`
}

func NewCertificateByResource added in v0.0.4

func NewCertificateByResource(user *User, cert *certificate.Resource) *Certificate

func RegistrationByProvider

func RegistrationByProvider(provider challenge.Provider, registration *Config, domains []string) (*Certificate, error)

func (*Certificate) X509Certificate added in v0.0.6

func (c *Certificate) X509Certificate() (*x509.Certificate, error)

func (*Certificate) X509PrivateKey added in v0.0.6

func (c *Certificate) X509PrivateKey() (any, error)

type Config

type Config struct {
	Email       string           `json:"email" yaml:"email" xml:"email"`
	Provider    string           `json:"provider" yaml:"provider" xml:"provider"`
	Options     *RegisterOptions `json:"options" yaml:"options" xml:"options"`
	Nameservers string           `json:"nameservers" yaml:"nameservers" xml:"nameservers"`
}

type Data added in v0.0.7

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

func NewData added in v0.0.7

func NewData(email string, regi IRegistration, opt *RegisterOptions) *Data

func (*Data) LoadUser added in v0.0.7

func (d *Data) LoadUser() (*User, error)

func (*Data) SaveUser added in v0.0.7

func (d *Data) SaveUser(user *User) error

type IRegistration

type IRegistration interface {
	URL() string
	UserAgent() string
	Resource(lego *lego.Client, opt *RegisterOptions) (*registration.Resource, error)
}

func GetRegistration

func GetRegistration(name string) (IRegistration, error)

type LegoUserData

type LegoUserData struct {
	Email        string                 `json:"email"`
	PrivateKey   string                 `json:"private_key"`
	Registration *registration.Resource `json:"registration"`
}

type RegisterOptions

type RegisterOptions struct {
	Kid         string `json:"kid" yaml:"kid" xml:"kid"`
	HmacEncoded string `json:"hmac_encoded" yaml:"hmacEncoded" xml:"hmacEncoded"`
}

type User

type User struct {
	Email        string                 `json:"email"`
	Key          crypto.PrivateKey      `json:"key"`
	Registration *registration.Resource `json:"registration"`
}

func LegoClient

func LegoClient(email string, regi IRegistration, opt *RegisterOptions) (*User, *lego.Client, 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

Jump to

Keyboard shortcuts

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