Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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 that a digital signature is valid.
VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName, DSASignatureFormat) |
Verifies that a digital signature is valid for the provided data. |
VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName) |
Verifies that a digital signature is valid by calculating the hash value of the data in a portion of a byte array using the specified hash algorithm and comparing it to the provided signature. |
VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, DSASignatureFormat) |
Verifies that a digital signature is valid for the provided data. |
VerifyData(Stream, Byte[], HashAlgorithmName, DSASignatureFormat) |
Verifies that a digital signature is valid for the provided data. |
VerifyData(Stream, Byte[], HashAlgorithmName) |
Verifies that a digital signature is valid by calculating the hash value of the specified stream using the specified hash algorithm and comparing it to the provided signature. |
VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName) |
Verifies that a digital signature is valid by calculating the hash value of the data in a byte span using the specified hash algorithm and comparing it to the provided signature. |
VerifyData(Byte[], Byte[], HashAlgorithmName) |
Verifies that a digital signature is valid by calculating the hash value of the specified data using the specified hash algorithm and comparing it to the provided signature. |
VerifyData(Byte[], Byte[], HashAlgorithmName, DSASignatureFormat) |
Verifies that a digital signature is valid for the provided data. |
Verifies that a digital signature is valid for the provided data.
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
An array that contains the signed data.
The starting index of the signed portion of data
.
The number of bytes in data
that were signed.
The signature to verify.
The hash algorithm used to hash the data for the verification process.
The encoding format for signature
.
true
if the digital signature is valid for the provided data; otherwise, false
.
data
or signature
is null
.
signatureFormat
is not a known format.
-or-
offset
is less than zero.
-or-
count
is less than zero.
-or-
offset
+ count
- 1 results in an index that is beyond the upper bound of data
.
hashAlgorithm
has a null
or empty Name.
An error occurred in the hashing or verification operation.
Product | Versions |
---|---|
.NET | 5, 6, 7, 8, 9, 10 |
Verifies that a digital signature is valid by calculating the hash value of the data in a portion of a byte array using the specified hash algorithm and comparing it to the provided signature.
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
The signed data.
The starting index at which to compute the hash.
The number of bytes to hash.
The signature data to be verified.
The hash algorithm used to create the hash value of the data.
true
if the digital signature is valid; otherwise, false
.
offset
is less than zero.
-or-
count
is less than zero.
-or-
offset
+ count
- 1 results in an index that is beyond the upper bound of data
.
The implementation type only supports legacy DSA (FIPS 186-2), and the hash algorithm is not SHA-1.
-or-
Verifying the signature otherwise failed.
Product | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.1 |
Verifies that a digital signature is valid for the provided data.
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
The signed data.
The signature to verify.
The hash algorithm used to hash the data for the verification process.
The encoding format for signature
.
true
if the digital signature is valid for the provided data; otherwise, false
.
signatureFormat
is not a known format.
An error occurred in the hashing or verification operation.
Product | Versions |
---|---|
.NET | 5, 6, 7, 8, 9, 10 |
Verifies that a digital signature is valid for the provided data.
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
The signed data.
The signature to verify.
The hash algorithm used to hash the data for the verification process.
The encoding format for signature
.
true
if the digital signature is valid for the provided data; otherwise, false
.
data
or signature
is null
.
signatureFormat
is not a known format.
hashAlgorithm
has a null
or empty Name.
An error occurred in the hashing or verification operation.
Product | Versions |
---|---|
.NET | 5, 6, 7, 8, 9, 10 |
Verifies that a digital signature is valid by calculating the hash value of the specified stream using the specified hash algorithm and comparing it to the provided signature.
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
The signed data.
The signature data to be verified.
The hash algorithm used to create the hash value of the data.
true
if the digital signature is valid; otherwise, false
.
The implementation type only supports legacy DSA (FIPS 186-2), and the hash algorithm is not SHA-1.
-or-
Verifying the signature otherwise failed.
Product | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.1 |
Verifies that a digital signature is valid by calculating the hash value of the data in a byte span using the specified hash algorithm and comparing it to the provided signature.
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
The signed data.
The signature to be verified.
The hash algorithm used to create the hash value of the data.
true
if the digital signature is valid; otherwise, false
.
The implementation type only supports legacy DSA (FIPS 186-2), and the hash algorithm is not SHA-1.
-or-
Verifying the signature otherwise failed.
Product | Versions |
---|---|
.NET | Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Standard | 2.1 |
Verifies that a digital signature is valid by calculating the hash value of the specified data using the specified hash algorithm and comparing it to the provided signature.
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
The signed data.
The signature data to be verified.
The hash algorithm used to create the hash value of the data.
true
if the digital signature is valid; otherwise, false
.
The implementation type only supports legacy DSA (FIPS 186-2), and the hash algorithm is not SHA-1.
-or-
Verifying the signature otherwise failed.
Product | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.1 |
Verifies that a digital signature is valid for the provided data.
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
The signed data.
The signature to verify.
The hash algorithm used to hash the data for the verification process.
The encoding format for signature
.
true
if the digital signature is valid for the provided data; otherwise, false
.
data
or signature
is null
.
signatureFormat
is not a known format.
hashAlgorithm
has a null
or empty Name.
An error occurred in the hashing or verification operation.
Product | Versions |
---|---|
.NET | 5, 6, 7, 8, 9, 10 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in