2015-06-08 00:36:07 +00:00
|
|
|
package acme
|
|
|
|
|
2015-10-23 14:24:02 +00:00
|
|
|
import (
|
2018-05-27 21:55:19 +00:00
|
|
|
"encoding/json"
|
2015-10-23 14:24:02 +00:00
|
|
|
"time"
|
|
|
|
)
|
2015-06-08 21:54:15 +00:00
|
|
|
|
2018-05-27 21:55:19 +00:00
|
|
|
// RegistrationResource represents all important informations about a registration
|
|
|
|
// of which the client needs to keep track itself.
|
|
|
|
type RegistrationResource struct {
|
|
|
|
Body accountMessage `json:"body,omitempty"`
|
|
|
|
URI string `json:"uri,omitempty"`
|
2015-09-26 20:59:16 +00:00
|
|
|
}
|
|
|
|
|
2018-05-27 21:55:19 +00:00
|
|
|
type directory struct {
|
|
|
|
NewNonceURL string `json:"newNonce"`
|
|
|
|
NewAccountURL string `json:"newAccount"`
|
|
|
|
NewOrderURL string `json:"newOrder"`
|
|
|
|
RevokeCertURL string `json:"revokeCert"`
|
|
|
|
KeyChangeURL string `json:"keyChange"`
|
|
|
|
Meta struct {
|
|
|
|
TermsOfService string `json:"termsOfService"`
|
|
|
|
Website string `json:"website"`
|
|
|
|
CaaIdentities []string `json:"caaIdentities"`
|
|
|
|
ExternalAccountRequired bool `json:"externalAccountRequired"`
|
|
|
|
} `json:"meta"`
|
2015-06-08 00:36:07 +00:00
|
|
|
}
|
|
|
|
|
2018-05-27 21:55:19 +00:00
|
|
|
type accountMessage struct {
|
|
|
|
Status string `json:"status,omitempty"`
|
|
|
|
Contact []string `json:"contact,omitempty"`
|
|
|
|
TermsOfServiceAgreed bool `json:"termsOfServiceAgreed,omitempty"`
|
|
|
|
Orders string `json:"orders,omitempty"`
|
|
|
|
OnlyReturnExisting bool `json:"onlyReturnExisting,omitempty"`
|
|
|
|
ExternalAccountBinding json.RawMessage `json:"externalAccountBinding,omitempty"`
|
2015-06-08 00:36:07 +00:00
|
|
|
}
|
|
|
|
|
2018-05-27 21:55:19 +00:00
|
|
|
type orderResource struct {
|
|
|
|
URL string `json:"url,omitempty"`
|
|
|
|
Domains []string `json:"domains,omitempty"`
|
|
|
|
orderMessage `json:"body,omitempty"`
|
2015-06-08 00:36:07 +00:00
|
|
|
}
|
2015-06-08 21:54:15 +00:00
|
|
|
|
2018-05-27 21:55:19 +00:00
|
|
|
type orderMessage struct {
|
|
|
|
Status string `json:"status,omitempty"`
|
|
|
|
Expires string `json:"expires,omitempty"`
|
|
|
|
Identifiers []identifier `json:"identifiers"`
|
|
|
|
NotBefore string `json:"notBefore,omitempty"`
|
|
|
|
NotAfter string `json:"notAfter,omitempty"`
|
|
|
|
Authorizations []string `json:"authorizations,omitempty"`
|
|
|
|
Finalize string `json:"finalize,omitempty"`
|
|
|
|
Certificate string `json:"certificate,omitempty"`
|
2015-06-08 21:54:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type authorization struct {
|
2018-05-27 21:55:19 +00:00
|
|
|
Status string `json:"status"`
|
|
|
|
Expires time.Time `json:"expires"`
|
|
|
|
Identifier identifier `json:"identifier"`
|
|
|
|
Challenges []challenge `json:"challenges"`
|
2015-06-08 21:54:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type identifier struct {
|
|
|
|
Type string `json:"type"`
|
|
|
|
Value string `json:"value"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type challenge struct {
|
2018-05-27 21:55:19 +00:00
|
|
|
URL string `json:"url"`
|
|
|
|
Type string `json:"type"`
|
|
|
|
Status string `json:"status"`
|
|
|
|
Token string `json:"token"`
|
|
|
|
Validated time.Time `json:"validated"`
|
|
|
|
KeyAuthorization string `json:"keyAuthorization"`
|
|
|
|
Error RemoteError `json:"error"`
|
2015-06-13 01:55:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type csrMessage struct {
|
2018-05-27 21:55:19 +00:00
|
|
|
Csr string `json:"csr"`
|
|
|
|
}
|
|
|
|
|
2015-09-27 12:51:44 +00:00
|
|
|
type revokeCertMessage struct {
|
|
|
|
Certificate string `json:"certificate"`
|
|
|
|
}
|
|
|
|
|
2017-04-26 23:46:52 +00:00
|
|
|
type deactivateAuthMessage struct {
|
2018-05-27 21:55:19 +00:00
|
|
|
Status string `jsom:"status"`
|
2017-04-26 23:46:52 +00:00
|
|
|
}
|
|
|
|
|
2015-06-13 01:55:53 +00:00
|
|
|
// CertificateResource represents a CA issued certificate.
|
2016-12-13 23:22:48 +00:00
|
|
|
// PrivateKey, Certificate and IssuerCertificate are all
|
|
|
|
// already PEM encoded and can be directly written to disk.
|
|
|
|
// Certificate may be a certificate bundle, depending on the
|
|
|
|
// options supplied to create it.
|
2015-06-13 01:55:53 +00:00
|
|
|
type CertificateResource struct {
|
2016-12-13 23:22:48 +00:00
|
|
|
Domain string `json:"domain"`
|
|
|
|
CertURL string `json:"certUrl"`
|
|
|
|
CertStableURL string `json:"certStableUrl"`
|
|
|
|
AccountRef string `json:"accountRef,omitempty"`
|
|
|
|
PrivateKey []byte `json:"-"`
|
|
|
|
Certificate []byte `json:"-"`
|
|
|
|
IssuerCertificate []byte `json:"-"`
|
|
|
|
CSR []byte `json:"-"`
|
2015-06-08 21:54:15 +00:00
|
|
|
}
|