I have the public key generated in c# with RSACryptoServiceProvider:
<RSAKeyValue>
<Modulus>
4kKhD/FWAMtQTRifArfXjxZN+6bOXTkHrVpyz/1wODhSOBqDewoSOFAp5boBd3wFjXszHA+gpUxZNWHRTj898Q==
</Modulus>
<Exponent>
AQAB
</Exponent>
<RSAKeyValue>
Those parameters are generated in a RSA variable initialized on 512 bits
new RSACryptoServiceProvider(512)
Now, I need to use these (modulus and exponent) to encrypt some data, but in groovy (groovyscript in a SoapUI Test). In groovy, I was testing RSA encrypt, and for its public key, it gets modulus and exponent with only decimal number. The Modulus above looks like a base64 string , but when I tried to decode in groovy, it gets some special characters, the code I use for that is
byte[] decoded = encoded.decodeBase64()
string s == new String(decoded)
what I finally need is know how to use the modulus and exponent obtained in c# to encrypt some data in groovy. Some help in how to do that?