mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2024-11-18 18:39:42 +00:00
f5d0dc7447
close #54 Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://codeberg.org/Codeberg/pages-server/pulls/65 Reviewed-by: Andreas Shimokawa <ashimokawa@noreply.codeberg.org>
29 lines
576 B
Go
29 lines
576 B
Go
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
|
|
}
|