func (le *LetsEncrypt) SaveAccount(dir string) error {
	if le.Account == nil {
		return errNoAccount
	}

	// Make sure directory exists before writing
	_ = os.MkdirAll(dir, 0777)

	err := fileio.SaveFile(filepath.Join(dir, "account.json"), le.Account)
	if err != nil {
		return err
	}

	// Convert key to PEM format
	s, err := privKeyToPEM(le.Key)
	if err != nil {
		return err
	}

	return fileio.SaveFile(filepath.Join(dir, "key.json"), s)
}
// SaveAccount will save the given ACME account and matching private Key into the Acme directory. This allows us to
// use the same account for requesting new certificates later on.
SaveAccount will save the given ACME account and matching private Key into the Acme directory. This allows us to
use the same account for requesting new certificates later on.
// SaveAccount will save the given ACME account and matching private Key into the Acme directory . This allows us to // use the same account for requesting new certificates later on .
func (le *LetsEncrypt) SaveAccount(dir string) error {
	if le.Account == nil {
		return errNoAccount
	}
	_ = os.MkdirAll(dir, 0777)
	err := fileio.SaveFile(filepath.Join(dir, "account.json"), le.Account)
	if err != nil {
		return err
	}
	s, err := privKeyToPEM(le.Key)
	if err != nil {
		return err
	}
	return fileio.SaveFile(filepath.Join(dir, "key.json"), s)
}
func ( le * LetsEncrypt ) SaveAccount ( dir string ) error { if le . Account == nil { return errNoAccount } _ = os . MkdirAll ( dir , 0777 ) err := fileio . SaveFile ( filepath . Join ( dir , " " ) , le . Account ) if err != nil { return err } s , err := privKeyToPEM ( le . Key ) if err != nil { return err } return fileio . SaveFile ( filepath . Join ( dir , " " ) , s ) }
SaveAccount will save the given ACME account and matching private Key into the Acme directory.
SaveAccount will save the given ACME account and matching private Key into the Acme directory .
// Make sure directory exists before writing // Convert key to PEM format