2019-03-11 18:56:48 +02:00
|
|
|
package cmd
|
2018-12-06 23:50:17 +02:00
|
|
|
|
|
|
|
import (
|
|
|
|
"crypto"
|
|
|
|
|
2020-09-02 03:20:01 +02:00
|
|
|
"github.com/go-acme/lego/v4/registration"
|
2018-12-06 23:50:17 +02:00
|
|
|
)
|
|
|
|
|
2020-05-08 19:35:25 +02:00
|
|
|
// Account represents a users local saved credentials.
|
2018-12-06 23:50:17 +02:00
|
|
|
type Account struct {
|
|
|
|
Email string `json:"email"`
|
|
|
|
Registration *registration.Resource `json:"registration"`
|
|
|
|
key crypto.PrivateKey
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Implementation of the registration.User interface **/
|
|
|
|
|
2020-05-08 19:35:25 +02:00
|
|
|
// GetEmail returns the email address for the account.
|
2018-12-06 23:50:17 +02:00
|
|
|
func (a *Account) GetEmail() string {
|
|
|
|
return a.Email
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetPrivateKey returns the private RSA account key.
|
|
|
|
func (a *Account) GetPrivateKey() crypto.PrivateKey {
|
|
|
|
return a.key
|
|
|
|
}
|
|
|
|
|
2020-05-08 19:35:25 +02:00
|
|
|
// GetRegistration returns the server registration.
|
2018-12-06 23:50:17 +02:00
|
|
|
func (a *Account) GetRegistration() *registration.Resource {
|
|
|
|
return a.Registration
|
|
|
|
}
|