MIP SDK Java Wrapper - Decrypting RPMSG Files

Viewed 352

We're trying to decrypt emails obtained via the Graph API. Since the Graph API only returns MIME messages and not MSGs, we can't decrypt the messages directly and are now looking for a method to decrypt the RPMSG attachment from the MIME message.

The documentation here says that the MIP SDK can unprotect RPMSG files.

However, when we try to do that with the Java wrapper using this code:

FileHandlerObserver observer = new FileHandlerObserver();
Future<IFileHandler> handlerFuture = fileEngine.createFileHandlerAsync(FILEPATH, FILEPATH, true, observer, null);

We get the following error:

java.util.concurrent.ExecutionException: com.microsoft.informationprotection.internal.gen.Error: ServiceDisabledError: RMS service is disabled for this tenant., CorrelationId=dd593faf-7b78-4aab-9ce5-0c0dc70a9744, CorrelationId.Description=FileEngine, HttpRequest.Id=374e9554-6a4e-4a3f-9487-9338c7093abc;20b1c623-dac9-4810-8a8a-50218028a111, ServiceDisabledError.Extent=Tenant
  at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
  at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
  ...
Caused by: com.microsoft.informationprotection.internal.gen.Error: ServiceDisabledError: RMS service is disabled for this tenant., CorrelationId=dd593faf-7b78-4aab-9ce5-0c0dc70a9744, CorrelationId.Description=FileEngine, HttpRequest.Id=374e9554-6a4e-4a3f-9487-9338c7093abc;20b1c623-dac9-4810-8a8a-50218028a111, ServiceDisabledError.Extent=Tenant
  at com.microsoft.informationprotection.internal.gen.SdkWrapperJNI.SwigDirector_FileHandler_Observer_OnCreateFileHandlerFailure(SdkWrapperJNI.java:1964)

We tried following the instructions to activate the service via Admin Center but this seems to be no longer supported.
Also, the instructions on activating the service via PowerShell result in a message saying that the service is already enabled.

What can we do to decrypt RPMSG files with the MIP SDK Java wrapper?

1 Answers

You'd have to verify that you own the item you're trying to decrypt. You won't be able to decrypt content owned by another tenant. That error makes me think that some other tenant might own it. The other possibility is a missing feature flag (see below).

It's worth noting that the SDK doesn't support decryption of message.rpmsg into a useful file format. It'll output only streams of data by using the IFileHandler.Inspect() APIs; the message body and attachments. If you require a usable file as an output, you'd need to convert the EML file to MSG, then remove protection.

The enable parsing of MSG and message.rpmsg files, you'll need to set a feature flag. Unfortunately, that override to enable the feature doesn't look to be supported in the 1.9 preview. It's in the 1.10 preview version, which I expect to release within the next week.

Related