package acme import ( "net" "time" ) const ( // LEV1 Let's Encrytpt V1 LEV1 = `https://acme-v01.api.letsencrypt.org/directory` // LEStaging Let's Encrypt Staging LEStaging = `https://acme-staging.api.letsencrypt.org/directory` ) // Directory ... type Directory struct { NewReg string `json:"new-reg"` RecoverReg string `json:"recover-reg"` NewAuthz string `json:"new-authz"` NewCert string `json:"new-cert"` RevokeCert string `json:"revoke-cert"` } // Registration Objects type Registration struct { Resource string `json:"resource"` // new-reg Contact []string `json:"contact,omitempty"` Agreement string `json:"agreement,omitempty"` Authorizations string `json:"authorizations,omitempty"` Certificates string `json:"certificates,omitempty"` } // RegistrationResp ... type RegistrationResp struct { ID int `json:"id"` Key Key `json:"key"` Contact []string `json:"contact"` InitialIP net.IP `json:"initialIp"` // not in draft CreatedAt time.Time `json:"createdAt"` // 2006-01-02T15:04:05.999999999Z } // Key contains public part of jose.JsonWebKey type Key struct { Kty string `json:"kty"` // RSA, EC E string `json:"e"` N string `json:"n"` } // Authorization request type Authorization struct { Resource string `json:"resource"` // new-authz Identifier Identifier `json:"identifier"` } // AuthorizationResp Objects type AuthorizationResp struct { Identifier Identifier `json:"identifier"` Status Status `json:"status,omitemtpy"` // e.g. valid Expires string `json:"expires,omitempty"` // 2006-01-02 Challenges []Challenge `json:"challenges"` Combinations [][]int `json:"combinations,omitemtpy"` } // Identifier ... type Identifier struct { Type string `json:"type"` // dns Value string `json:"value"` // example.com } // Challege ... type Challege struct { Type string `json:"type"` // http-01 Status Status `json:"status"` // e.g. valid Validated string `json:"validated"` // 2006-01-02T15:04Z KeyAuthorization string `json:"keyAuthorization"` } // Problem description type Problem struct { Type string `json:"type"` Detail string `json:"detail"` Instance string `json:"instance"` }