ECDsaCng.VerifyData 方法

定义

验证数字签名。

重载

VerifyData(Byte[], Byte[])

验证指定的数据的数字签名。

VerifyData(Stream, Byte[])

通过读取数据流的末尾内容验证指定数据流的数字签名。

VerifyData(Byte[], Int32, Int32, Byte[])

从指定的偏移量开始验证指定长度的数据的签名。

VerifyData(Byte[], Byte[])

验证指定的数据的数字签名。

public:
 bool VerifyData(cli::array <System::Byte> ^ data, cli::array <System::Byte> ^ signature);
public bool VerifyData (byte[] data, byte[] signature);
override this.VerifyData : byte[] * byte[] -> bool
member this.VerifyData : byte[] * byte[] -> bool
Public Function VerifyData (data As Byte(), signature As Byte()) As Boolean

参数

data
Byte[]

已签名的数据。

signature
Byte[]

要验证的签名。

返回

Boolean

如果签名有效,则为 true;否则为 false

例外

datasignaturenull

注解

此方法使用 HashAlgorithm 属性对输入数据进行哈希处理,然后对结果进行签名,从而生成给定数据的签名。

适用于

VerifyData(Stream, Byte[])

通过读取数据流的末尾内容验证指定数据流的数字签名。

public:
 bool VerifyData(System::IO::Stream ^ data, cli::array <System::Byte> ^ signature);
public bool VerifyData (System.IO.Stream data, byte[] signature);
[System.Security.SecurityCritical]
public bool VerifyData (System.IO.Stream data, byte[] signature);
override this.VerifyData : System.IO.Stream * byte[] -> bool
[<System.Security.SecurityCritical>]
member this.VerifyData : System.IO.Stream * byte[] -> bool
member this.VerifyData : System.IO.Stream * byte[] -> bool
Public Function VerifyData (data As Stream, signature As Byte()) As Boolean

参数

data
Stream

已签名的数据流。

signature
Byte[]

要验证的签名。

返回

Boolean

如果签名有效,则为 true;否则为 false

属性

例外

datasignaturenull

注解

此方法在验证之前使用 HashAlgorithm 属性对输入数据进行哈希处理。

适用于

VerifyData(Byte[], Int32, Int32, Byte[])

从指定的偏移量开始验证指定长度的数据的签名。

public:
 bool VerifyData(cli::array <System::Byte> ^ data, int offset, int count, cli::array <System::Byte> ^ signature);
public bool VerifyData (byte[] data, int offset, int count, byte[] signature);
[System.Security.SecurityCritical]
public bool VerifyData (byte[] data, int offset, int count, byte[] signature);
override this.VerifyData : byte[] * int * int * byte[] -> bool
[<System.Security.SecurityCritical>]
member this.VerifyData : byte[] * int * int * byte[] -> bool
member this.VerifyData : byte[] * int * int * byte[] -> bool
Public Function VerifyData (data As Byte(), offset As Integer, count As Integer, signature As Byte()) As Boolean

参数

data
Byte[]

已签名的数据。

offset
Int32

数据中已签名数据开始的位置。

count
Int32

紧跟在将要签名的 offset 后的数据长度(以字符为单位)。

signature
Byte[]

要验证的签名。

返回

Boolean

如果签名有效,则为 true;否则为 false

属性

例外

offsetcount 小于零。

  • 或 - offsetcount 大于在 data 参数中传递的字节数组的长度。

datasignaturenull

注解

此方法在验证之前使用 HashAlgorithm 属性对输入数据进行哈希处理。

适用于