2021-12-05 15:33:56 +00:00
|
|
|
package certificates
|
|
|
|
|
|
|
|
import (
|
|
|
|
"crypto"
|
|
|
|
|
|
|
|
"github.com/go-acme/lego/v4/registration"
|
|
|
|
)
|
|
|
|
|
|
|
|
type AcmeAccount struct {
|
|
|
|
Email string
|
|
|
|
Registration *registration.Resource
|
|
|
|
Key crypto.PrivateKey `json:"-"`
|
|
|
|
KeyPEM string `json:"Key"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// make sure AcmeAccount match User interface
|
|
|
|
var _ registration.User = &AcmeAccount{}
|
|
|
|
|
|
|
|
func (u *AcmeAccount) GetEmail() string {
|
|
|
|
return u.Email
|
|
|
|
}
|
2022-03-27 19:54:06 +00:00
|
|
|
|
2021-12-05 15:33:56 +00:00
|
|
|
func (u AcmeAccount) GetRegistration() *registration.Resource {
|
|
|
|
return u.Registration
|
|
|
|
}
|
2022-03-27 19:54:06 +00:00
|
|
|
|
2021-12-05 15:33:56 +00:00
|
|
|
func (u *AcmeAccount) GetPrivateKey() crypto.PrivateKey {
|
|
|
|
return u.Key
|
|
|
|
}
|