mv acme config setup into own func

This commit is contained in:
6543 2021-12-05 16:33:56 +01:00
parent 77e39b2213
commit 11fa729686
No known key found for this signature in database
GPG key ID: C99B82E40B027BAE
3 changed files with 106 additions and 84 deletions

View file

@ -0,0 +1,27 @@
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
}
func (u AcmeAccount) GetRegistration() *registration.Resource {
return u.Registration
}
func (u *AcmeAccount) GetPrivateKey() crypto.PrivateKey {
return u.Key
}