Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello everyone,

I wanna ask question about RSA sign on C#.

I have one document for sign. I have plain hex values of modulus, private exponent and public exponent. I dont' t want to signing with random generated keys. When I try with sign with sign tool, i have got result perfectly. But i can' t do it with C#. I am new for this kind of problem. So i am really stucked.

I looked a lot of sites and arcticles but i couldn't find any solution. Maybe there is but i can' t get it, i don' t know.

If you could explain to me with details(step-step), i will really be grateful.

Thanks a lot.

What I have tried:

I tried a lots of solutions from internet but, its couldn't work.
Posted
Updated 2-Aug-17 0:21am

1 solution

You can create an RSAParameters instance:
RSAParameters Structure (System.Security.Cryptography)[^]
And then pass those in an RSACryptoServiceProvider[^]:
C#
RSAParameters parameters = new RSAParameters
{
    D = ...,
    DP = ...,
    ....
};
using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider())
{
    rsa.ImportParameters(parameters);
    // rest of your code; read the RSACryptoServiceProvider documentation to see what you can do with it; I believe you're interested in the 'SignData' method
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900