Исключение при расшифровке файлов .msg с помощью MIP SDK: NoPolicyException: политика меток не содержит данныхC#

Место общения программистов C#
Ответить Пред. темаСлед. тема
Anonymous
 Исключение при расшифровке файлов .msg с помощью MIP SDK: NoPolicyException: политика меток не содержит данных

Сообщение Anonymous »

Я следовал этому и этому, чтобы расшифровать .msg с помощью MIP SDK. Ниже приведен мой код:

Код: Выделить всё

class Program
{
private const string clientId = "[test client id here]";
private const string appName = "MIPSDKTestApp";

static void Main(string[] args)
{
Console.WriteLine("Provide path to protected msg file:");
string inputFilePath = Console.ReadLine();
string outputFilePath = Path.Combine(Path.GetDirectoryName(inputFilePath), "Unprotected_" + Path.GetFileName(inputFilePath));

// Initialize Wrapper for File API operations.
MIP.Initialize(MipComponent.File);

// Create ApplicationInfo, setting the clientID from Azure AD App Registration as the ApplicationId.
ApplicationInfo appInfo = new ApplicationInfo()
{
ApplicationId = clientId,
ApplicationName = appName,
ApplicationVersion = "1.0.0"
};

// Instantiate the AuthDelegateImpl object, passing in AppInfo.
AuthDelegateImplementation authDelegate = new AuthDelegateImplementation(appInfo);

MipContext mipContext = MIP.CreateMipContext(appInfo,
"mip_data",
LogLevel.Trace,
null,
null);

// Initialize and instantiate the File Profile.
// Create the FileProfileSettings object.
// Initialize file profile settings to create/use local state.
var profileSettings = new FileProfileSettings(mipContext,
CacheStorageType.OnDiskEncrypted,
new ConsentDelegateImplementation());

// Load the Profile async and wait for the result.
var fileProfile = Task.Run(async () => await MIP.LoadFileProfileAsync(profileSettings)).Result;

// Create a FileEngineSettings object, then use that to add an engine to the profile.
var customSettings = new List();
customSettings.Add(new KeyValuePair("enable_msg_file_type", "true"));

// Create a FileEngineSettings object, then use that to add an engine to the profile.
var engineSettings = new FileEngineSettings("[user@tenant]", authDelegate, "", CultureInfo.CurrentCulture.Name);
engineSettings.Identity = new Identity("[user@tenant]");

//set custom settings for the engine
engineSettings.CustomSettings = customSettings;

var fileEngine = Task.Run(async () => await fileProfile.AddEngineAsync(engineSettings)).Result; // EXCEPTION THROWN HERE

var handler = Task.Run(async () => await fileEngine.CreateFileHandlerAsync(inputFilePath,
inputFilePath,
true)).Result;

handler.RemoveProtection();

var result = Task.Run(async () => await handler.CommitAsync(outputFilePath)).Result;

// Application Shutdown
handler = null; // This will be used in later quick starts.
fileEngine = null;
fileProfile = null;
mipContext = null;

}
}
Однако выдается следующая ошибка:
NoPolicyException: политика меток не содержит данных, CorrelationId=3268dfdf-2ea3-4958-9c72-fe88ae3c6f59, CorrelationId.Description=PolicyProfile, NoPolicyError.Category=SyncFile, NoPolicyError.Category=SyncFile
at

Код: Выделить всё

var fileEngine = Task.Run(async () => await fileProfile.AddEngineAsync(engineSettings)).Result;
Может ли кто-нибудь указать, что я делаю не так?

Подробнее здесь: https://stackoverflow.com/questions/640 ... l-policy-d
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение
  • Исключение при расшифровке файлов .msg с помощью MIP SDK: NoPolicyException: политика меток не содержит данных
    Anonymous » » в форуме C#
    0 Ответы
    11 Просмотры
    Последнее сообщение Anonymous
  • YII, как показать пользовательский MSG с ошибкой с помощью проверки сбой MSG
    Anonymous » » в форуме Php
    0 Ответы
    4 Просмотры
    Последнее сообщение Anonymous
  • Чтение вложений .msg из файла .msg
    Anonymous » » в форуме Python
    0 Ответы
    35 Просмотры
    Последнее сообщение Anonymous
  • Чтение вложений .msg из файла .msg
    Anonymous » » в форуме Python
    0 Ответы
    29 Просмотры
    Последнее сообщение Anonymous
  • Чтение вложений .msg из файла .msg
    Anonymous » » в форуме Python
    0 Ответы
    24 Просмотры
    Последнее сообщение Anonymous

Вернуться в «C#»