2015-06-08 00:36:07 +00:00
|
|
|
package acme
|
|
|
|
|
2015-06-08 21:54:15 +00:00
|
|
|
import "time"
|
|
|
|
|
2015-09-26 20:59:16 +00:00
|
|
|
type directory struct {
|
|
|
|
NewAuthzURL string `json:"new-authz"`
|
|
|
|
NewCertURL string `json:"new-cert"`
|
|
|
|
NewRegURL string `json:"new-reg"`
|
|
|
|
RevokeCertURL string `json:"revoke-cert"`
|
|
|
|
}
|
|
|
|
|
2015-06-08 00:36:07 +00:00
|
|
|
type registrationMessage struct {
|
2015-09-26 17:45:52 +00:00
|
|
|
Resource string `json:"resource"`
|
|
|
|
Contact []string `json:"contact"`
|
2015-06-08 00:36:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Registration is returned by the ACME server after the registration
|
|
|
|
// The client implementation should save this registration somewhere.
|
|
|
|
type Registration struct {
|
2015-09-26 17:45:52 +00:00
|
|
|
Resource string `json:"resource,omitempty"`
|
|
|
|
ID int `json:"id"`
|
|
|
|
Key struct {
|
2015-06-08 00:36:07 +00:00
|
|
|
Kty string `json:"kty"`
|
|
|
|
N string `json:"n"`
|
|
|
|
E string `json:"e"`
|
|
|
|
} `json:"key"`
|
2015-09-26 17:45:52 +00:00
|
|
|
Contact []string `json:"contact"`
|
|
|
|
Agreement string `json:"agreement,omitempty"`
|
|
|
|
Authorizations string `json:"authorizations,omitempty"`
|
|
|
|
Certificates string `json:"certificates,omitempty"`
|
2015-06-08 00:36:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// RegistrationResource represents all important informations about a registration
|
|
|
|
// of which the client needs to keep track itself.
|
|
|
|
type RegistrationResource struct {
|
|
|
|
Body Registration
|
|
|
|
URI string
|
|
|
|
NewAuthzURL string
|
|
|
|
TosURL string
|
|
|
|
}
|
2015-06-08 21:54:15 +00:00
|
|
|
|
|
|
|
type authorizationResource struct {
|
|
|
|
Body authorization
|
|
|
|
Domain string
|
|
|
|
NewCertURL string
|
2015-06-13 01:56:34 +00:00
|
|
|
AuthURL string
|
2015-06-08 21:54:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type authorization struct {
|
2015-09-26 17:45:52 +00:00
|
|
|
Resource string `json:"resource,omitempty"`
|
2015-06-08 21:54:15 +00:00
|
|
|
Identifier identifier `json:"identifier"`
|
|
|
|
Status string `json:"status,omitempty"`
|
|
|
|
Expires time.Time `json:"expires,omitempty"`
|
|
|
|
Challenges []challenge `json:"challenges,omitempty"`
|
|
|
|
Combinations [][]int `json:"combinations,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type identifier struct {
|
|
|
|
Type string `json:"type"`
|
|
|
|
Value string `json:"value"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type challenge struct {
|
2015-09-26 17:45:52 +00:00
|
|
|
Resource string `json:"resource,omitempty"`
|
|
|
|
Type string `json:"type,omitempty"`
|
|
|
|
Status string `json:"status,omitempty"`
|
|
|
|
URI string `json:"uri,omitempty"`
|
|
|
|
Token string `json:"token,omitempty"`
|
|
|
|
Tls bool `json:"tls,omitempty"`
|
2015-06-13 01:55:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type csrMessage struct {
|
2015-09-26 17:45:52 +00:00
|
|
|
Resource string `json:"resource,omitempty"`
|
2015-06-13 02:10:32 +00:00
|
|
|
Csr string `json:"csr"`
|
|
|
|
Authorizations []string `json:"authorizations"`
|
2015-06-13 01:55:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// CertificateResource represents a CA issued certificate.
|
|
|
|
// PrivateKey and Certificate are both already PEM encoded
|
|
|
|
// and can be directly written to disk.
|
|
|
|
type CertificateResource struct {
|
|
|
|
Domain string
|
|
|
|
CertURL string
|
|
|
|
PrivateKey []byte
|
|
|
|
Certificate []byte
|
2015-06-08 21:54:15 +00:00
|
|
|
}
|