我正在阅读这篇文章,有两个字节数组,一个用于签名数据,一个用于原始数据。
byte[] originalData = ByteConverter.GetBytes(dataString);
byte[] signedData;
我们签署数据,这部分没问题,但我无法理解为什么要使用原始数据进行验证?
// Hash and sign the data.
signedData = HashAndSignBytes(originalData, Key);
// Verify the data and display the result to the
// console.
VerifySignedHash(originalData, signedData, Key);
举个例子,我们在服务端签署一个数据并发送给客户端,客户端想知道我是否发送了那个数据,为什么我要发送原始数据直到客户端可以验证呢?
有一些帖子以同样的方式做到了: