It depends on what encryption algorithm they're using. Assuming that you're talking about RSA, .NET offers RSACryptoServiceProvider. I'm not very familiar with Bouncy Castle, but I'm sure it can handle RSA too.
D365fO has excellent capabilities to integrate third party DLLs or you could build your own code in Visual Studio youself.
Business Applications communities