如何在c#.NET中实现数字签名

问题描述:

大家好,

任何人都可以告诉我如何在c#.neT中实现数字签名。





谢谢,

MOHAMMAD SIDDIQALI。

Hi to all ,
Can any one tell me how to implement digital signing in c#.neT.


Thanks,
MOHAMMAD SIDDIQALI.

数字歌唱(在密码学下)是一个广泛的领域。那么你对签名究竟想做些什么呢?



对于Hashing,MAC和DS,所有人都在做一些(不完全)类似的工作。在不同场景下使用。所以请澄清你的确切要求。



更新了我的评论。



你需要哈希才能进行数字签名一个文件。因为数字签名是由哈希创建的。



Digital singing (under the Cryptography) is a broad area. So what you exactly want to do with signing?

When comes to Hashing, MACs and DSs, all are doing somewhat (not exactly) similar job. Using under different scenarios. So please clarify your exact requirement.

Updated my comment.

You need a hash to digitally sign a document. Because digital signatures are created from hash.

SHA1 mySha1 = new SHA1CryptoServiceProvider();
byte[] hash = mySha1 .ComputeHash(byte_array);





确保将文档放在字节数组中。如果它更大,你必须考虑更好的实现。



使用生成的哈希创建数字签名。看看 DSACryptoServiceProvider 。然后使用收到的数据验证签名并按照您的意愿处理数据。



Make sure to have your document in a byte array. If it's larger one you have to think about a better implementation.

Create a digital signature using generated Hash. Have a look at DSACryptoServiceProvider. Then with the received data verify the signature and deals with the data as you wish.


HI,



为此您可以请参阅以下链接



在.NET中实施数字签名 [ ^ ]



http://dotnetslackers.com/articles/security/Hashing_MACs_and_Digital_Signatures_in_NET.aspx [ ^ ]


for this you can refer the below links

Implementing Digital Signing in .NET[^]

http://dotnetslackers.com/articles/security/Hashing_MACs_and_Digital_Signatures_in_NET.aspx[^]

>

Hi Coding Lover。



*感谢您的快速回复。我想申请数字签名上传机密文件。

*我的客户他的网站有多少用户,当他们上传文件时,应该为文件申请数字签名。希望你理解它,我会等你的回复。





谢谢,

MOHAMMAD SIDDIQALI。
Hi Coding Lover.

*Thanks for very quick response.I want to apply digital signature for uploading confidential documents.
*My client have number of users for his site and,When ever they upload the document digital signature should be applied for the document.Hope you have understood it and i will be waiting for your response.


Thanks,
MOHAMMAD SIDDIQALI.