-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
45 lines (40 loc) · 1.5 KB
/
types.go
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
package certmaker
import (
"crypto/x509"
"net/http"
"time"
)
// SimpleRequest defines a request for a new certificate and private key. The field Subject
// is optional and can be omitted. Days can be between 1 and 182. If the value is higher than 182, then it
// will be set to 182 on the server side. If it is lower than 1, it will be set to 1 on the server side.
//
// You can either supply zero or more Domains, zero or more IPs and zero or more EmailAddresses.
type SimpleRequest struct {
Domains []string `json:"domains"`
IPs []string `json:"ips"`
EmailAddresses []string `json:"emails"`
Subject SimpleRequestSubject `json:"subject,omitempty"`
Days int `json:"days"`
}
// SimpleRequestSubject represents the subject of a SimpleRequest
type SimpleRequestSubject struct {
Organization string `json:"organization"`
Country string `json:"country"`
Province string `json:"province"`
Locality string `json:"locality"`
StreetAddress string `json:"street_address"`
PostalCode string `json:"postal_code"`
}
// updater contains data relevant to automatic certificate updating
type updater struct {
cache *Cache
simpleRequest *SimpleRequest
csr *x509.CertificateRequest
}
// ClientSettings represent meta data useful for altering the behaviour of a *Client
type ClientSettings struct {
Transport *http.Transport
ClientTimeout time.Duration
StrictMode bool
ChallengePort uint16
}