DSA.VerifySignature 方法

定义

重载

VerifySignature(Byte[], Byte[])

当在派生类中重写时,验证指定数据的 DSA 签名。When overridden in a derived class, verifies the DSA signature for the specified data.

VerifySignature(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

验证数字签名对于所提供的数据哈希是否有效。Verifies that a digital signature is valid for a provided data hash.

VerifySignature(Byte[], Byte[])

当在派生类中重写时,验证指定数据的 DSA 签名。When overridden in a derived class, verifies the DSA signature for the specified data.

public:
 abstract bool VerifySignature(cli::array <System::Byte> ^ rgbHash, cli::array <System::Byte> ^ rgbSignature);
public abstract bool VerifySignature (byte[] rgbHash, byte[] rgbSignature);
abstract member VerifySignature : byte[] * byte[] -> bool
Public MustOverride Function VerifySignature (rgbHash As Byte(), rgbSignature As Byte()) As Boolean

参数

rgbHash
Byte[]

rgbSignature 签名的数据的哈希值。The hash of the data signed with rgbSignature.

rgbSignature
Byte[]

要为 rgbData 验证的签名。The signature to be verified for rgbData.

返回

如果 rgbSignature 与使用指定的哈希算法和密钥在 rgbHash 上计算出的签名匹配,则为 true;否则为 falsetrue if rgbSignature matches the signature computed using the specified hash algorithm and key on rgbHash; otherwise, false.

异常

实现类型仅支持旧版 DSA (FIPS 186-2),并且哈希值的长度不是 20 字节。The implementation type only supports legacy DSA (FIPS 186-2), and the hash value is not 20 bytes long.

-or-

验证签名失败。Verifying the signature otherwise failed.

另请参阅

VerifySignature(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

验证数字签名对于所提供的数据哈希是否有效。Verifies that a digital signature is valid for a provided data hash.

public:
 virtual bool VerifySignature(ReadOnlySpan<System::Byte> hash, ReadOnlySpan<System::Byte> signature);
public virtual bool VerifySignature (ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature);
abstract member VerifySignature : ReadOnlySpan<byte> * ReadOnlySpan<byte> -> bool
override this.VerifySignature : ReadOnlySpan<byte> * ReadOnlySpan<byte> -> bool
Public Overridable Function VerifySignature (hash As ReadOnlySpan(Of Byte), signature As ReadOnlySpan(Of Byte)) As Boolean

参数

hash
ReadOnlySpan<Byte>

要验证的数据哈希。The data hash to verify.

signature
ReadOnlySpan<Byte>

要验证的签名。The signature to be verify.

返回

如果数字签名对哈希值有效,则为 true;否则为 falsetrue if the digital signature is valid for the hash; otherwise, false.

异常

实现类型仅支持旧版 DSA (FIPS 186-2),并且哈希值的长度不是 20 字节。The implementation type only supports legacy DSA (FIPS 186-2), and the hash value is not 20 bytes long.

-or-

验证签名失败。Verifying the signature otherwise failed.

注解

此方法的默认实现在将范围复制到数组后调用 VerifySignature(Byte[], Byte[])The default implementation of this method calls VerifySignature(Byte[], Byte[]) after copying the spans to arrays. 派生类型应重写此方法,以避免中间数组创建。Derived types should override this method to avoid the intermediate array creation.

适用于