account.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright (C) 2019-2023 Nicola Murino
  2. //
  3. // This program is free software: you can redistribute it and/or modify
  4. // it under the terms of the GNU Affero General Public License as published
  5. // by the Free Software Foundation, version 3.
  6. //
  7. // This program is distributed in the hope that it will be useful,
  8. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. // GNU Affero General Public License for more details.
  11. //
  12. // You should have received a copy of the GNU Affero General Public License
  13. // along with this program. If not, see <https://www.gnu.org/licenses/>.
  14. package acme
  15. import (
  16. "crypto"
  17. "github.com/go-acme/lego/v4/registration"
  18. )
  19. type account struct {
  20. Email string `json:"email"`
  21. Registration *registration.Resource `json:"registration"`
  22. key crypto.PrivateKey
  23. }
  24. /** Implementation of the registration.User interface **/
  25. // GetEmail returns the email address for the account.
  26. func (a *account) GetEmail() string {
  27. return a.Email
  28. }
  29. // GetRegistration returns the server registration.
  30. func (a *account) GetRegistration() *registration.Resource {
  31. return a.Registration
  32. }
  33. // GetPrivateKey returns the private account key.
  34. func (a *account) GetPrivateKey() crypto.PrivateKey {
  35. return a.key
  36. }
  37. /** End **/