private void UpdateCredentials(Credentials credentials) { var updatedIoTConfiguration = new IoTConfigurationSection() { SerialNumberEncrypted = cipherService.EncodeString(credentials.Login), PasswordEncrypted = cipherService.EncodeString(credentials.Password) }; configurationManager.UpdateConfiguration(config => config.IoTConfiguration = updatedIoTConfiguration); }
public async Task <byte[]> ExportAsync() { ServiceDataDTO data = await LoadDataToDTOAsync(); string jsonData = JsonSerializer.Serialize(data); string jsonDataEncoded = _cipherService.EncodeString(jsonData); return(Encoding.UTF8.GetBytes(jsonDataEncoded)); }