aboutsummaryrefslogtreecommitdiff
path: root/messages.go
blob: c469c5be0faf755812fd5e872a6a86d8479d7c46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package acme

import jose "github.com/square/go-jose"

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"`
	Key            jose.JsonWebKey `json:"key"`
	Contact        []string        `json:"contact,omitempty"`
	Agreement      string          `json:"agreement,omitempty"`
	Authorizations string          `json:"authorizations,omitempty"`
	Certificates   string          `json:"certificates,omitempty"`
}

// Authorization Objects
type Authorization struct {
	Identifier   Identifier  `json:"identifier"`
	Status       string      `json:"status,omitemtpy"`  // valid
	Expires      string      `json:"expires,omitempty"` // 2015-03-01
	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           string `json:"status"`    // valid
	Validated        string `json:"validated"` // 2014-12-01T12:05Z
	KeyAuthorization string `json:"keyAuthorization"`
}