2018-03-05 19:54:04 +00:00
|
|
|
package acme
|
|
|
|
|
2019-07-19 09:52:04 +00:00
|
|
|
// StoredData represents the data managed by Store.
|
2018-03-05 19:54:04 +00:00
|
|
|
type StoredData struct {
|
2019-07-19 09:52:04 +00:00
|
|
|
Account *Account
|
|
|
|
Certificates []*CertAndStore
|
|
|
|
}
|
|
|
|
|
|
|
|
// StoredChallengeData represents the data managed by ChallengeStore.
|
|
|
|
type StoredChallengeData struct {
|
2018-03-05 19:54:04 +00:00
|
|
|
HTTPChallenges map[string]map[string][]byte
|
2018-07-03 10:44:04 +00:00
|
|
|
TLSChallenges map[string]*Certificate
|
2018-03-05 19:54:04 +00:00
|
|
|
}
|
|
|
|
|
2019-07-19 09:52:04 +00:00
|
|
|
// Store is a generic interface that represents a storage.
|
2018-03-05 19:54:04 +00:00
|
|
|
type Store interface {
|
2019-07-19 09:52:04 +00:00
|
|
|
GetAccount(string) (*Account, error)
|
|
|
|
SaveAccount(string, *Account) error
|
|
|
|
GetCertificates(string) ([]*CertAndStore, error)
|
|
|
|
SaveCertificates(string, []*CertAndStore) error
|
|
|
|
}
|
2018-07-03 10:44:04 +00:00
|
|
|
|
2019-07-19 09:52:04 +00:00
|
|
|
// ChallengeStore is a generic interface that represents a store for challenge data.
|
|
|
|
type ChallengeStore interface {
|
2018-07-09 21:28:03 +00:00
|
|
|
GetHTTPChallengeToken(token, domain string) ([]byte, error)
|
|
|
|
SetHTTPChallengeToken(token, domain string, keyAuth []byte) error
|
|
|
|
RemoveHTTPChallengeToken(token, domain string) error
|
2018-07-03 10:44:04 +00:00
|
|
|
|
|
|
|
AddTLSChallenge(domain string, cert *Certificate) error
|
|
|
|
GetTLSChallenge(domain string) (*Certificate, error)
|
|
|
|
RemoveTLSChallenge(domain string) error
|
2018-03-05 19:54:04 +00:00
|
|
|
}
|