Application illustrates use of unmanaged RMS API with RMS Connector. According to the input it will encrypt or decrypt file.
- Installed and configured Azure RMS Connector on a server
- Installed AD RMS Client 2.1
- Applied registry settings that will redirect all RMS communication to RMS Connector. This registry setttings should by applied on computer/server that is used for running the AzureRMSTestApp
The application implements three methods:
- List all available RMS templates (IpcGetTemplateList)
- Decrypt encrypted file (IpcfDecryptFile)
- Encrypt file (IpcfEncryptFile)
Unfortunatelly method that is used for file encryption does not work and ends with an error IPCERROR_NEEDS_ONLINE even if offline flag is set to false.
SafeFileApiNativeMethods.IpcfEncryptFile(
inputFile: filePath,
templateId: template.TemplateId,
flags: SafeFileApiNativeMethods.EncryptFlags.IPCF_EF_FLAG_DEFAULT,
suppressUI: true,
offline: false,
hasUserConsent: true,
parentForm: null,
symmKey: null,
outputDirectory: null);
According to the IPC log the error arise earlier in ippuseridentity.cpp:Microsoft::InformationProtection::IPPUserIdentity::GetNewIdentity
which ignores offline flag set to false.