xacme

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package xacme implements part of rfc8555. https://tools.ietf.org/html/rfc8555

Index

Constants

View Source
const (
	CaLetsencrypt                               = "letsencrypt"
	CaLetsencryptStaging                        = "letsencrypt_staging"
	CaLetsencryptRootCaKeyIdIsrgRootX1          = "79:B4:59:E6:7B:B6:E5:E4:01:73:80:08:88:C8:1A:58:F6:E9:9B:6E"
	CaLetsencryptRootCaKeyIdDstRootCaX3         = "C4:A7:B1:A4:7B:2C:71:FA:DB:E1:4B:90:75:FF:C4:15:60:85:89:10"
	CaLetsencryptStagingRootCaKeyIdFakeLeRootX1 = "C1:26:74:A4:8A:44:A0:E6:FA:20:28:D8:5C:23:9A:45:88:18:79:E0"
	CaLetsencryptStagingRootCaKeyIdFakeLeRootX2 = "1B:FB:1C:F0:31:7D:03:2B:DA:0A:9B:AF:78:A6:F6:99:91:19:9C:B2"
)

Variables

This section is empty.

Functions

func FmtX509KeyID

func FmtX509KeyID(id []byte) string

func GetJWKThumbprintWithBase64url

func GetJWKThumbprintWithBase64url(key interface{}) (string, error)

func NewAcmeNonce

func NewAcmeNonce(url string) *acmeNonce

func Sha256WithBase64url

func Sha256WithBase64url(b []byte) (d string)

Types

type Account

type Account struct {
	Contact       []string
	TOSAgreed     bool
	AcctURL       string
	PrivateKey    *ecdsa.PrivateKey
	PemPrivateKey string
}

Account contains acme account data.

type CaMeta

type CaMeta struct {
	DirURL      string
	NewAcctURL  string
	NewOrderURL string
	NewNonceURL string
}

CaMeta contains the Directory URL.

type CertInfo

type CertInfo struct {
	SignatureAlgorithm   string
	PemCertPrivateKey    string
	PemCertChain         string
	PemCertBody          string
	PemCertBodyWithChain string
	NotBefore            string
	NotAfter             string
	RootCAKeyID          string
}

Account contains signed cert info.

type Client

type Client interface {
	// CreateAccountWithEmail create acme account with email.
	CreateAccountWithEmail(email string, TOSAgreed bool) (*Account, error)
	// SetAccount set Account for acme client.
	SetAccount(acct *Account) (*Account, error)
	// CreateAccountWithPrivateKey create acme account with private key.
	CreateAccountWithPrivateKey(acct *Account) (*Account, error)
	// SignCertWithDNS sign certificate with dns-01 Challenge.
	SignCertWithDNS(sr *IdlSignReq, opts ...Option) (*CertInfo, error)
}

Client is the acme client interface.

func NewClient

func NewClient(conf *Config, opts ...Option) Client

NewClient return a acme client.

type Config

type Config struct {
	CA  string
	Dns *xdns.Config
}

Config configures a Client when creating.

type HTTPHeaderLink struct {
	URL    string
	Rel    string
	Params map[string]string
}
func GetHTTPHeaderLink(ss []string) []HTTPHeaderLink

type IdlChallenge

type IdlChallenge struct {
	Type  string
	URL   string `json:"url"`
	Token string
}

type IdlIdentifier

type IdlIdentifier struct {
	Type  string
	Value string
}

type IdlReqNewAccountPayload

type IdlReqNewAccountPayload struct {
	TermsOfServiceAgreed bool `json:"termsOfServiceAgreed"`
	Contact              []string
}

type IdlReqNewOrderPayload

type IdlReqNewOrderPayload struct {
	Identifiers []IdlIdentifier
	NotBefore   string `json:"NotBefore"`
	NotAfter    string `json:"NotAfter"`
}

type IdlRespDir

type IdlRespDir struct {
	KeyChange string `json:"keyChange"`
	Meta      struct {
		CaaIdentities  []string `json:"caaIdentities"`
		TermsOfService string   `json:"termsOfService"`
		Website        string
	}
	NewAccount string `json:"newAccount"`
	NewNonce   string `json:"newNonce"`
	NewOrder   string `json:"newOrder"`
	RevokeCert string `json:"revokeCert"`
}

type IdlRespDownLoadAuthorizationResources

type IdlRespDownLoadAuthorizationResources struct {
	Status     string
	Expires    string
	Identifier IdlIdentifier
	Challenges []IdlChallenge
}

type IdlRespErr

type IdlRespErr struct {
	Type   string
	Detail string
}

type IdlRespFinalize

type IdlRespFinalize struct {
	Status         string
	Expires        string
	NotBefore      string `json:"NotBefore"`
	NotAfter       string `json:"NotAfter"`
	Identifiers    []IdlIdentifier
	Authorizations []string
	Finalize       string
	Certificate    string
}

type IdlRespNewAccount

type IdlRespNewAccount struct {
	Status  string
	Contact []string
	Order   string
}

type IdlRespNewOrder

type IdlRespNewOrder struct {
	Status         string
	Expires        string
	NotBefore      string `json:"NotBefore"`
	NotAfter       string `json:"NotAfter"`
	Identifiers    []IdlIdentifier
	Authorizations []string
	Finalize       string
}

type IdlSignReq

type IdlSignReq struct {
	Identifiers []IdlIdentifier
	TXTCname    string
}

type Option

type Option func(opt *option)

Option configures option.

func WithRootCAKeyID

func WithRootCAKeyID(id string) Option

WithRootCAKeyID chooses which Root CA to use.

Jump to

Keyboard shortcuts

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