-as a pair (n,d)
-as a quintuple (p, q, dP, dQ, qInv)
I have the private key in the 2nd format, but when I create an
RSAParameters with these parameters I get the error "bad data" when I
use it with my RSACryptoServiceProvider. I've tried using a key from
another source where I have access to all these variables and if I
include everything (including n and d) it works.
Do I always need to calculate d for my RSAParameters?
I'm not really sure of the maths, I have all the variables apart from d
as byte arrays
Is there an easy way of calculating d to complete my RSAParameters?
(I guess I'll need to think about dealing with big numbers and whole
number arithmetic.)
Thanks in advance for your help.
In the end I used a library from http://www.bouncycastle.org which lets
you initialise a private key with CRT (Chinese Remainder Theorem)
parameters (the quintuple above).
Don't know why you can't do this with MS' version. Looks like it's based
on some very old Windows cryptography code and could do with an update.