最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

accessing email attachments encrypted with MAM InTune in an iOS app written in donnet8 C# - Stack Overflow

programmeradmin4浏览0评论

This was so simple until some decided to turn on MAM Intune for email.

we wrote a small iOS utility that receives some serial numbers in a CSV file sent via email as an attachment.

it has worked well for about 5 years until some decided to turn on some corporate encryption scheme so all the attachments now come encrypted.

I understand that I have to make the app an Intune managed application I am OK with that it I could only figure out how.

the app is written in C# dotnet8 and NO it is not using MAUI just plain UIKIT app written in DotNet8

I found this

public void DecryptAndReadFile(string filePath)
            {
                var managedFile = IntuneMAMFile.Open(filePath);
                if (managedFile != null && managedFile.IsEncrypted)
                {
                    // Decrypt the file at the specified path
                    managedFile.DecryptFileAtPath(filePath);
                    Console.WriteLine("File decrypted successfully.");

                    // Read the content of the decrypted file
                    using (var stream = managedFile.OpenRead())
                    {
                        using (var reader = new StreamReader(stream))
                        {
                            string content = reader.ReadToEnd();
                            Console.WriteLine("File Content: ");
                            Console.WriteLine(content);
                        }
                    }
                }
                else
                {
                    Console.WriteLine("File is not encrypted or does not exist.");
                }
            }

but from what I can gather that code requires this library

dotnet add package Microsoft.Intune.MAM.Xamarin.iOS

which will not install because it dose not support DotNet8.

it has been suggested that I use the library Microsoft.Intunes.MAUI.Essinsials.iOS

but I can't find any instructions on how to use this library.

anyone know of an solution ?

Regards Christian Arild Stœr Andersen

发布评论

评论列表(0)

  1. 暂无评论