func (le *LetsEncrypt) RegisterAccount(email string) error {
	// Create public/private key pair.
	privKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
	if err != nil {
		return err
	}

	// Needed to set here so acmeClient.register() will work
	le.AcmeClient.Key = privKey

	account := &acme.Account{
		Contact: []string{"mailto:" + email},
	}
	account, err = le.AcmeClient.Register(le.Ctx, account, acme.AcceptTOS)
	if err != nil {
		return err
	}

	// Set the rest of the settings
	le.Key = privKey
	le.Account = account

	return nil
}
// RegisterAccount will register a new account with LetsEncrypt based on the given email. It automatically generates
// a new private key which is used for communication. This key must be set in the AcmeClient in order to communicate
// with LetsEncrypt.
RegisterAccount will register a new account with LetsEncrypt based on the given email. It automatically generates
a new private key which is used for communication. This key must be set in the AcmeClient in order to communicate
with LetsEncrypt.
// RegisterAccount will register a new account with LetsEncrypt based on the given email . It automatically generates // a new private key which is used for communication . This key must be set in the AcmeClient in order to communicate // with LetsEncrypt .
func (le *LetsEncrypt) RegisterAccount(email string) error {
	privKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
	if err != nil {
		return err
	}
	le.AcmeClient.Key = privKey
	account := &acme.Account{
		Contact: []string{"mailto:" + email},
	}
	account, err = le.AcmeClient.Register(le.Ctx, account, acme.AcceptTOS)
	if err != nil {
		return err
	}
	le.Key = privKey
	le.Account = account
	return nil
}
func ( le * LetsEncrypt ) RegisterAccount ( email string ) error { privKey , err := ecdsa . GenerateKey ( elliptic . P256 ( ) , rand . Reader ) if err != nil { return err } le . AcmeClient . Key = privKey account := & acme . Account { Contact : [ ] string { " " + email } , } account , err = le . AcmeClient . Register ( le . Ctx , account , acme . AcceptTOS ) if err != nil { return err } le . Key = privKey le . Account = account return nil }
RegisterAccount will register a new account with LetsEncrypt based on the given email.
RegisterAccount will register a new account with LetsEncrypt based on the given email .
// Create public/private key pair. // Needed to set here so acmeClient.register() will work // Set the rest of the settings