DSA.VerifyData 方法

定義

驗證數位簽章是否有效。

多載

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

驗證數位簽章對提供的資料是否有效。

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

使用指定的雜湊演算法,並和提供的簽章比較,來為指定的部分位元組陣列計算出資料的雜湊值,便藉此驗證數位簽章是否有效。

VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, DSASignatureFormat)

驗證數位簽章對提供的資料是否有效。

VerifyData(Stream, Byte[], HashAlgorithmName, DSASignatureFormat)

驗證數位簽章對提供的資料是否有效。

VerifyData(Stream, Byte[], HashAlgorithmName)

使用指定的雜湊演算法,並和提供的簽章比較,來為指定的資料流計算出雜湊值,藉此驗證數位簽章是否有效。

VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName)

使用指定的雜湊演算法,並和提供的簽章比較,來為位元組範圍中的資料計算出雜湊值,藉此驗證數位簽章是否有效。

VerifyData(Byte[], Byte[], HashAlgorithmName)

使用指定的雜湊演算法,並和提供的簽章比較,來為指定的資料計算出雜湊值,藉此驗證數位簽章是否有效。

VerifyData(Byte[], Byte[], HashAlgorithmName, DSASignatureFormat)

驗證數位簽章對提供的資料是否有效。

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

來源:
DSA.cs
來源:
DSA.cs
來源:
DSA.cs

驗證數位簽章對提供的資料是否有效。

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

參數

data
Byte[]

包含已簽署資料的陣列。

offset
Int32

data 的已簽署部分的起始索引。

count
Int32

data 中已簽署的位元組數目。

signature
Byte[]

要驗證的簽章。

hashAlgorithm
HashAlgorithmName

雜湊演算法,用來雜湊處理驗證程序的資料。

signatureFormat
DSASignatureFormat

signature 的編碼格式。

傳回

若數位簽章對提供的資料是有效的,則為 true;否則為 false

例外狀況

datasignaturenull

signatureFormat 不是已知的格式。

-或- offset 小於零。

-或- count 小於零。

-或- offset + count -1 會產生超出上限 data 的索引。

hashAlgorithm 具有 null 或空白 Name

雜湊處理或驗證作業發生錯誤。

適用於

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

來源:
DSA.cs
來源:
DSA.cs
來源:
DSA.cs

使用指定的雜湊演算法,並和提供的簽章比較,來為指定的部分位元組陣列計算出資料的雜湊值,便藉此驗證數位簽章是否有效。

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

參數

data
Byte[]

已簽署的資料。

offset
Int32

用來計算雜湊值的起始索引。

count
Int32

要雜湊的位元組數。

signature
Byte[]

要驗證的簽章資料。

hashAlgorithm
HashAlgorithmName

用來建立該資料雜湊值的雜湊演算法。

傳回

如果數位簽章有效則為 true,否則為 false

例外狀況

datanull

-或-

signaturenull

hashAlgorithm.NamenullEmpty

offset 小於零。

-或-

count 小於零。

-或-

offset + count - 1 產生的索引超出 data 上限。

實作類型只支援舊版 DSA (FIPS 186-2),且雜湊演算法不是 SHA-1。

-或-

驗證簽章失敗。

適用於

VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, DSASignatureFormat)

來源:
DSA.cs
來源:
DSA.cs
來源:
DSA.cs

驗證數位簽章對提供的資料是否有效。

public:
 bool VerifyData(ReadOnlySpan<System::Byte> data, ReadOnlySpan<System::Byte> signature, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::DSASignatureFormat signatureFormat);
public bool VerifyData (ReadOnlySpan<byte> data, ReadOnlySpan<byte> signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat);
member this.VerifyData : ReadOnlySpan<byte> * ReadOnlySpan<byte> * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.DSASignatureFormat -> bool
Public Function VerifyData (data As ReadOnlySpan(Of Byte), signature As ReadOnlySpan(Of Byte), hashAlgorithm As HashAlgorithmName, signatureFormat As DSASignatureFormat) As Boolean

參數

data
ReadOnlySpan<Byte>

已簽署的資料。

signature
ReadOnlySpan<Byte>

要驗證的簽章。

hashAlgorithm
HashAlgorithmName

雜湊演算法,用來雜湊處理驗證程序的資料。

signatureFormat
DSASignatureFormat

signature 的編碼格式。

傳回

若數位簽章對提供的資料是有效的,則為 true;否則為 false

例外狀況

signatureFormat 不是已知的格式。

雜湊處理或驗證作業發生錯誤。

適用於

VerifyData(Stream, Byte[], HashAlgorithmName, DSASignatureFormat)

來源:
DSA.cs
來源:
DSA.cs
來源:
DSA.cs

驗證數位簽章對提供的資料是否有效。

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

參數

data
Stream

已簽署的資料。

signature
Byte[]

要驗證的簽章。

hashAlgorithm
HashAlgorithmName

雜湊演算法,用來雜湊處理驗證程序的資料。

signatureFormat
DSASignatureFormat

signature 的編碼格式。

傳回

若數位簽章對提供的資料是有效的,則為 true;否則為 false

例外狀況

datasignaturenull

signatureFormat 不是已知的格式。

hashAlgorithm 具有 null 或空白 Name

雜湊處理或驗證作業發生錯誤。

適用於

VerifyData(Stream, Byte[], HashAlgorithmName)

來源:
DSA.cs
來源:
DSA.cs
來源:
DSA.cs

使用指定的雜湊演算法,並和提供的簽章比較,來為指定的資料流計算出雜湊值,藉此驗證數位簽章是否有效。

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

參數

data
Stream

已簽署的資料。

signature
Byte[]

要驗證的簽章資料。

hashAlgorithm
HashAlgorithmName

用來建立該資料雜湊值的雜湊演算法。

傳回

如果數位簽章有效則為 true,否則為 false

例外狀況

datanull

-或-

signaturenull

hashAlgorithm.NamenullEmpty

實作類型只支援舊版 DSA (FIPS 186-2),且雜湊演算法不是 SHA-1。

-或-

驗證簽章失敗。

適用於

VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName)

來源:
DSA.cs
來源:
DSA.cs
來源:
DSA.cs

使用指定的雜湊演算法,並和提供的簽章比較,來為位元組範圍中的資料計算出雜湊值,藉此驗證數位簽章是否有效。

public:
 virtual bool VerifyData(ReadOnlySpan<System::Byte> data, ReadOnlySpan<System::Byte> signature, System::Security::Cryptography::HashAlgorithmName hashAlgorithm);
public virtual bool VerifyData (ReadOnlySpan<byte> data, ReadOnlySpan<byte> signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm);
abstract member VerifyData : ReadOnlySpan<byte> * ReadOnlySpan<byte> * System.Security.Cryptography.HashAlgorithmName -> bool
override this.VerifyData : ReadOnlySpan<byte> * ReadOnlySpan<byte> * System.Security.Cryptography.HashAlgorithmName -> bool
Public Overridable Function VerifyData (data As ReadOnlySpan(Of Byte), signature As ReadOnlySpan(Of Byte), hashAlgorithm As HashAlgorithmName) As Boolean

參數

data
ReadOnlySpan<Byte>

已簽署的資料。

signature
ReadOnlySpan<Byte>

要驗證的簽章。

hashAlgorithm
HashAlgorithmName

用來建立該資料雜湊值的雜湊演算法。

傳回

如果數位簽章有效則為 true,否則為 false

例外狀況

hashAlgorithm.NamenullEmpty

實作類型只支援舊版 DSA (FIPS 186-2),且雜湊演算法不是 SHA-1。

-或-

驗證簽章失敗。

適用於

VerifyData(Byte[], Byte[], HashAlgorithmName)

來源:
DSA.cs
來源:
DSA.cs
來源:
DSA.cs

使用指定的雜湊演算法,並和提供的簽章比較,來為指定的資料計算出雜湊值,藉此驗證數位簽章是否有效。

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

參數

data
Byte[]

已簽署的資料。

signature
Byte[]

要驗證的簽章資料。

hashAlgorithm
HashAlgorithmName

用來建立該資料雜湊值的雜湊演算法。

傳回

如果數位簽章有效則為 true,否則為 false

例外狀況

datanull

-或-

signaturenull

實作類型只支援舊版 DSA (FIPS 186-2),且雜湊演算法不是 SHA-1。

-或-

驗證簽章失敗。

hashAlgorithm.NamenullEmpty

適用於

VerifyData(Byte[], Byte[], HashAlgorithmName, DSASignatureFormat)

來源:
DSA.cs
來源:
DSA.cs
來源:
DSA.cs

驗證數位簽章對提供的資料是否有效。

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

參數

data
Byte[]

已簽署的資料。

signature
Byte[]

要驗證的簽章。

hashAlgorithm
HashAlgorithmName

雜湊演算法,用來雜湊處理驗證程序的資料。

signatureFormat
DSASignatureFormat

signature 的編碼格式。

傳回

若數位簽章對提供的資料是有效的,則為 true;否則為 false

例外狀況

datasignaturenull

signatureFormat 不是已知的格式。

hashAlgorithm 具有 null 或空白 Name

雜湊處理或驗證作業發生錯誤。

適用於