Error while using “IpcCreateLicenseFromTemplateId” function in RMS SDK 2.1

Copper Contributor

Hi,

I am using RMS client 2.1 SDK to apply protection on PDF file.

Client has provided us with template ID.

But when I try to use the function "IpcCreateLicenseFromTemplateId" I get error 

“The System cannot find the file specified. HRESULT: 0x80070002”.

****************************************************************************************

string viewAndPrint = "xxxxx-xxxx-xxx-xxxx-xxxxxxxx";

//Error in thisline

SafeInformationProtectionLicenseHandle handle = SafeNativeMethods.IpcCreateLicenseFromTemplateId(viewAndPrint);

 

SafeNativeMethods.IpcSetLicenseUserRightsList(handle, userRights);

SafeNativeMethods.IpcSetLicenseValidityTime(handle, term);

 

string encryptedFilePath = SafeFileApiNativeMethods.IpcfEncryptFile(
filePath,
handle,
SafeFileApiNativeMethods.EncryptFlags.IPCF_EF_FLAG_KEY_NO_PERSIST,
true,false,true,null,symmetricKeyCred);

****************************************************************************************

Help me solve this error.

 

 

3 Replies

@chandrashekharazad @Tom Moser , any chance you can provide some pointers on troubleshooting this? Does this function behave differently in the MIP SDK?

@Enrique Saggese It's different than MIP SDK. I don't have any experience with RMS SDK to be very helpful, but if I had to guess I'd say that the file path is invalid or the client hasn't bootstrapped and downloaded templates. A procmon trace should help you find what file the process is missing.

@Enrique Saggese I wasn't able to find the solution for the error yet. Raised a request with Azure support. They have sent the request to backend team to analyse it.