DSACryptoServiceProvider.VerifyHash(Byte[], String, Byte[]) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Verifies the specified signature data by comparing it to the signature computed for the specified hash value.
public:
bool VerifyHash(cli::array <System::Byte> ^ rgbHash, System::String ^ str, cli::array <System::Byte> ^ rgbSignature);
public bool VerifyHash (byte[] rgbHash, string? str, byte[] rgbSignature);
public bool VerifyHash (byte[] rgbHash, string str, byte[] rgbSignature);
member this.VerifyHash : byte[] * string * byte[] -> bool
Public Function VerifyHash (rgbHash As Byte(), str As String, rgbSignature As Byte()) As Boolean
Parameters
- rgbHash
- Byte[]
The hash value of the data to be signed.
- str
- String
The name of the hash algorithm used to create the hash value of the data.
- rgbSignature
- Byte[]
The signature data to be verified.
Returns
true
if the signature verifies as valid; otherwise, false
.
Exceptions
The cryptographic service provider (CSP) cannot be acquired.
-or-
The signature cannot be verified.
Remarks
This method verifies the DSA digital signature produced by SignHash.
If the str
parameter is null
, the default hash algorithm (SHA1) is used. The valid hash algorithms is SHA1.
Due to collision problems with SHA1, Microsoft recommends a security model based on SHA256 or better.
Applies to
See also
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈