Click here to Skip to main content
15,904,934 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all


i had created the digital signature for Plain text using C#.net
i need to verify that signature is correct or not


i had a sample code to generate the digital signature

byte[] x_plaintext = Encoding.Default.GetBytes(TextBox7.Text);
       // create a hash code for the plaintext, using the SHA-1 algorithm
       byte[] x_hashcode = HashAlgorithm.Create("SHA1").ComputeHash(x_plaintext);
       // create an instance of the DSA implementation class
       DSACryptoServiceProvider x_dsa = new DSACryptoServiceProvider();

       // create the signature formatter
       DSASignatureFormatter x_formatter = new DSASignatureFormatter();
       // set the instance of the DSA algorithm that will sign the data
       x_formatter.SetKey(x_dsa);
       // set the name of the hashing algorithm we used to create the hash code
       x_formatter.SetHashAlgorithm("SHA1");
       // create the formatted DSA signature
       byte[] x_signature = x_formatter.CreateSignature(x_hashcode);
       TextBox8.Text = Convert.ToBase64String(x_signature);



then i need to verify so please try to replay me
Thanks alot
Posted
Comments
Nickos_me 30-Jun-11 9:29am    
My stupid question - do you use x.509 to store private and public keys?
If you do, I can answer your question, but if not - answer is interesting for me.

Please, answer my comment.

To you - you can read this.
It's in VB.NET, but code is very simple, so you can translate it into C#.
 
Share this answer
 
Comments
V V S GANGA SUJAN 30-Jun-11 10:24am    
i had not got any type of link
 
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