We need to RSA encrypt XML data before sending to a third party web service. The encryption has to happen in Salesforce using public key provided by the service provider.
I have looked at code here by Mats Roshauw https://gist.github.com/karmats/4270441be5a34fff7062. The code seems to work but has a limitation where the length of XML data cannot be more than length of modulus part of public key.
Can someone please help with RSA encrypting XML data without such length restrictions?
Thank you for your time.