acme

package
v0.0.0-...-d8a4e70 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CAGoogleCN           = "https://gts.rat.dev/directory"
	CAGoogle             = "https://dv.acme-v02.api.pki.goog/directory"
	CALetsEncryptStaging = "https://acme-staging-v02.api.letsencrypt.org/directory"
	CALetsEncrypt        = "https://acme-v02.api.letsencrypt.org/directory"
	CAZeroSSL            = "https://acme.zerossl.com/v2/DV90"
	CABuypass            = "https://api.buypass.com/acme/directory"
	CASSLcom             = "https://acme.ssl.com/sslcom-dv-rsa"
)
View Source
const (
	KeyEC256   = KeyType("P256")
	KeyEC384   = KeyType("P384")
	KeyRSA2048 = KeyType("2048")
	KeyRSA3072 = KeyType("3072")
	KeyRSA4096 = KeyType("4096")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Certificate

type Certificate struct {
	PrivateKey []byte
	acme.Certificate
}

type Client

type Client struct {
	Account acme.Account
	// contains filtered or unexported fields
}

func NewPrivateKeyAccount

func NewPrivateKeyAccount(email string, privateKey string, CA string, eab *EAB) (*Client, error)

func NewRegisterAccount

func NewRegisterAccount(ctx context.Context, email, CA string, eab *EAB, keyType KeyType) (*Client, error)

func (Client) CleanUp

func (s Client) CleanUp(_ context.Context, _ acme.Challenge) error

func (*Client) GetDNSRecords

func (c *Client) GetDNSRecords(ctx context.Context, domains []string, keyType KeyType) ([]DNSRecord, error)

GetDNSRecords 获取 DNS 解析(手动设置)

func (*Client) ObtainCertificate

func (c *Client) ObtainCertificate(ctx context.Context, domains []string, keyType KeyType) (Certificate, error)

ObtainCertificate 签发 SSL 证书

func (*Client) ObtainCertificateManual

func (c *Client) ObtainCertificateManual() (Certificate, error)

ObtainCertificateManual 手动验证 SSL 证书

func (Client) Present

func (s Client) Present(ctx context.Context, challenge acme.Challenge) error

func (*Client) RenewCertificate

func (c *Client) RenewCertificate(ctx context.Context, certUrl string, domains []string, keyType KeyType) (Certificate, error)

RenewCertificate 续签 SSL 证书

func (*Client) UseDns

func (c *Client) UseDns(dnsType DnsType, param DNSParam)

UseDns 使用 DNS 接口验证

func (*Client) UseHTTP

func (c *Client) UseHTTP(conf string)

UseHTTP 使用 HTTP 验证 conf nginx 配置文件路径 path 验证文件存放路径

func (*Client) UseManualDns

func (c *Client) UseManualDns(total int, check ...bool)

UseManualDns 使用手动 DNS 验证

type DNSParam

type DNSParam struct {
	AK string `form:"ak" json:"ak"`
	SK string `form:"sk" json:"sk"`
}

type DNSProvider

type DNSProvider interface {
	libdns.RecordSetter
	libdns.RecordDeleter
}

type DNSRecord

type DNSRecord struct {
	Name   string `json:"name"`
	Domain string `json:"domain"`
	Value  string `json:"value"`
}

type DnsType

type DnsType string
const (
	Tencent    DnsType = "tencent"
	AliYun     DnsType = "aliyun"
	Huawei     DnsType = "huawei"
	CloudFlare DnsType = "cloudflare"
)

type EAB

type EAB = acme.EAB

type KeyType

type KeyType string

Jump to

Keyboard shortcuts

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