ECDsa.VerifyData 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 that a digital signature is appropriate for the current key and provided data with a specified hash algorithm.
Overloads
VerifyData(Byte[], Byte[], HashAlgorithmName) |
Verifies that a digital signature is appropriate for the current key and provided data with a specified hash algorithm. |
VerifyData(Stream, Byte[], HashAlgorithmName) |
Verifies that a digital signature is appropriate for the current key and provided data with a specified hash algorithm. |
VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName) |
Verifies that a digital signature is appropriate for the current key and provided data with a specified hash algorithm. |
VerifyData(Byte[], 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(ReadOnlySpan<Byte>, ReadOnlySpan<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 appropriate for the current key and provided portion of data with a specified hash algorithm. |
VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName, DSASignatureFormat) |
Verifies that a digital signature is valid for the provided data. |
VerifyData(Byte[], Byte[], HashAlgorithmName)
- Source:
- ECDsa.cs
- Source:
- ECDsa.cs
- Source:
- ECDsa.cs
Verifies that a digital signature is appropriate for the current key and provided data with a specified hash algorithm.
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
Parameters
- data
- Byte[]
The signed data.
- signature
- Byte[]
The signature data to be verified.
- hashAlgorithm
- HashAlgorithmName
The hash algorithm used to create the hash value of the data.
Returns
true
if the signature is valid; otherwise, false
.
Exceptions
Applies to
VerifyData(Stream, Byte[], HashAlgorithmName)
- Source:
- ECDsa.cs
- Source:
- ECDsa.cs
- Source:
- ECDsa.cs
Verifies that a digital signature is appropriate for the current key and provided data with a specified hash algorithm.
public:
bool VerifyData(System::IO::Stream ^ data, cli::array <System::Byte> ^ signature, System::Security::Cryptography::HashAlgorithmName hashAlgorithm);
public bool VerifyData (System.IO.Stream data, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm);
member this.VerifyData : System.IO.Stream * byte[] * System.Security.Cryptography.HashAlgorithmName -> bool
Public Function VerifyData (data As Stream, signature As Byte(), hashAlgorithm As HashAlgorithmName) As Boolean
Parameters
- data
- Stream
The signed data.
- signature
- Byte[]
The signature data to be verified.
- hashAlgorithm
- HashAlgorithmName
The hash algorithm used to create the hash value of the data.
Returns
true
if the signature is valid; otherwise, false
.
Exceptions
Applies to
VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName)
- Source:
- ECDsa.cs
- Source:
- ECDsa.cs
- Source:
- ECDsa.cs
Verifies that a digital signature is appropriate for the current key and provided data with a specified hash algorithm.
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
Parameters
- data
- ReadOnlySpan<Byte>
The signed data.
- signature
- ReadOnlySpan<Byte>
The signature to be verified.
- hashAlgorithm
- HashAlgorithmName
The hash algorithm used to create the hash value of the data.
Returns
true
if the signature is valid; otherwise, false
.
Exceptions
Applies to
VerifyData(Byte[], Byte[], HashAlgorithmName, DSASignatureFormat)
- Source:
- ECDsa.cs
- Source:
- ECDsa.cs
- Source:
- ECDsa.cs
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
Parameters
- data
- Byte[]
The signed data.
- signature
- Byte[]
The signature to verify.
- hashAlgorithm
- HashAlgorithmName
The hash algorithm used to hash the data for the verification process.
- signatureFormat
- DSASignatureFormat
The encoding format for signature
.
Returns
true
if the digital signature is valid for the provided data; otherwise, false
.
Exceptions
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.
Applies to
VerifyData(Stream, Byte[], HashAlgorithmName, DSASignatureFormat)
- Source:
- ECDsa.cs
- Source:
- ECDsa.cs
- Source:
- ECDsa.cs
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
Parameters
- data
- Stream
The signed data.
- signature
- Byte[]
The signature to verify.
- hashAlgorithm
- HashAlgorithmName
The hash algorithm used to hash the data for the verification process.
- signatureFormat
- DSASignatureFormat
The encoding format for signature
.
Returns
true
if the digital signature is valid for the provided data; otherwise, false
.
Exceptions
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.
Applies to
VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, DSASignatureFormat)
- Source:
- ECDsa.cs
- Source:
- ECDsa.cs
- Source:
- ECDsa.cs
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
Parameters
- data
- ReadOnlySpan<Byte>
The signed data.
- signature
- ReadOnlySpan<Byte>
The signature to verify.
- hashAlgorithm
- HashAlgorithmName
The hash algorithm used to hash the data for the verification process.
- signatureFormat
- DSASignatureFormat
The encoding format for signature
.
Returns
true
if the digital signature is valid for the provided data; otherwise, false
.
Exceptions
signatureFormat
is not a known format.
An error occurred in the hashing or verification operation.
Applies to
VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName)
- Source:
- ECDsa.cs
- Source:
- ECDsa.cs
- Source:
- ECDsa.cs
Verifies that a digital signature is appropriate for the current key and provided portion of data with a specified hash algorithm.
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
Parameters
- data
- Byte[]
The signed data.
- offset
- Int32
The starting index at which to compute the hash.
- count
- Int32
The number of bytes to hash.
- signature
- Byte[]
The signature data to be verified.
- hashAlgorithm
- HashAlgorithmName
The hash algorithm used to create the hash value of the data.
Returns
true
if the signature is valid; otherwise, false
.
Exceptions
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
.
Applies to
VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName, DSASignatureFormat)
- Source:
- ECDsa.cs
- Source:
- ECDsa.cs
- Source:
- ECDsa.cs
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
Parameters
- data
- Byte[]
An array that contains the signed data.
- offset
- Int32
The starting index of the signed portion of data
.
- count
- Int32
The number of bytes in data
that were signed.
- signature
- Byte[]
The signature to verify.
- hashAlgorithm
- HashAlgorithmName
The hash algorithm used to hash the data for the verification process.
- signatureFormat
- DSASignatureFormat
The encoding format for signature
.
Returns
true
if the digital signature is valid for the provided data; otherwise, false
.
Exceptions
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.