Hi All,
We used RSA algorithm for encryption mechanism. It's done in C# and it generated public and private XML files.
Now we want to decrypt the message in Java using privatekey.xml.
"<BitStrength>512</BitStrength>
<RSAKeyValue>
<Modulus>bp+VnREDCrjXk2rYLO8Cw==</Modulus>
<Exponent>AB</Exponent>
<P>9RaE0bETZDNbTAUs=</P>
<Q>y9ZkzQAmrdvjyA4L+5CIEE=</Q>
<DP>GdARrJTH4/FQwmc=</DP>
<DQ>SEH3+Uhd9nvsAE=</DQ>
<InverseQ>ZssVlzUgA8hE=</InverseQ>
<D>vssaRCZSkm3RClMTCyVyRnjIAQ==</D>
</RSAKeyValue>"
By googling we got a class RSAPrivateCrtKeySpec which accepts 8 parameters which are there in xml -
public RSAPrivateCrtKeySpec(BigInteger modulus,
BigInteger publicExponent,
BigInteger privateExponent,
BigInteger primeP,
BigInteger primeQ,
BigInteger primeExponentP,
BigInteger primeExponentQ,
BigInteger crtCoefficient)
I have provided all the values and it's throwing NumberFormatException because values contain =+u/ etc...
Please advice me of how to approach this problem.
Thanks,
Kranthi Kiran