RSA.VerifyData Method
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[], Byte[], HashAlgorithmName, RSASignaturePadding) |
Verifies that a digital signature is valid by calculating the hash value of the specified data using the specified hash algorithm and padding, and comparing it to the provided signature. |
VerifyData(Stream, Byte[], HashAlgorithmName, RSASignaturePadding) |
Verifies that a digital signature is valid by calculating the hash value of the specified stream using the specified hash algorithm and padding, and comparing it to the provided signature. |
VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding) |
Verifies that a digital signature is valid by calculating the hash value of the specified data using the specified hash algorithm and padding, and comparing it to the provided signature. |
VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName, RSASignaturePadding) |
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 padding, and comparing it to the provided signature. |
- Source:
- RSA.cs
- Source:
- RSA.cs
- Source:
- RSA.cs
Verifies that a digital signature is valid by calculating the hash value of the specified data using the specified hash algorithm and padding, 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, System::Security::Cryptography::RSASignaturePadding ^ padding);
public bool VerifyData (byte[] data, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding);
member this.VerifyData : byte[] * byte[] * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.RSASignaturePadding -> bool
Public Function VerifyData (data As Byte(), signature As Byte(), hashAlgorithm As HashAlgorithmName, padding As RSASignaturePadding) 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.
- padding
- RSASignaturePadding
The padding mode.
Returns
true
if the signature is valid; otherwise, false
.
Exceptions
padding
is unknown, or not supported by this implementation.
Applies to
.NET 9 en andere versies
Product | Versies |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.3, 1.4, 1.6, 2.0, 2.1 |
- Source:
- RSA.cs
- Source:
- RSA.cs
- Source:
- RSA.cs
Verifies that a digital signature is valid by calculating the hash value of the specified stream using the specified hash algorithm and padding, and comparing it to the provided signature.
public:
bool VerifyData(System::IO::Stream ^ data, cli::array <System::Byte> ^ signature, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::RSASignaturePadding ^ padding);
public bool VerifyData (System.IO.Stream data, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding);
member this.VerifyData : System.IO.Stream * byte[] * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.RSASignaturePadding -> bool
Public Function VerifyData (data As Stream, signature As Byte(), hashAlgorithm As HashAlgorithmName, padding As RSASignaturePadding) 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.
- padding
- RSASignaturePadding
The padding mode.
Returns
true
if the signature is valid; otherwise, false
.
Exceptions
padding
is unknown, or not supported by this implementation.
Applies to
.NET 9 en andere versies
Product | Versies |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.3, 1.4, 1.6, 2.0, 2.1 |
- Source:
- RSA.cs
- Source:
- RSA.cs
- Source:
- RSA.cs
Verifies that a digital signature is valid by calculating the hash value of the specified data using the specified hash algorithm and padding, and comparing it to the provided signature.
public:
virtual bool VerifyData(ReadOnlySpan<System::Byte> data, ReadOnlySpan<System::Byte> signature, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::RSASignaturePadding ^ padding);
public virtual bool VerifyData (ReadOnlySpan<byte> data, ReadOnlySpan<byte> signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding);
abstract member VerifyData : ReadOnlySpan<byte> * ReadOnlySpan<byte> * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.RSASignaturePadding -> bool
override this.VerifyData : ReadOnlySpan<byte> * ReadOnlySpan<byte> * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.RSASignaturePadding -> bool
Public Overridable Function VerifyData (data As ReadOnlySpan(Of Byte), signature As ReadOnlySpan(Of Byte), hashAlgorithm As HashAlgorithmName, padding As RSASignaturePadding) As Boolean
Parameters
- data
- ReadOnlySpan<Byte>
The signed data.
- signature
- ReadOnlySpan<Byte>
The signature data to be verified.
- hashAlgorithm
- HashAlgorithmName
The hash algorithm used to create the hash value of the data.
- padding
- RSASignaturePadding
The padding mode.
Returns
true
if the signature is valid; otherwise, false
.
Exceptions
padding
is unknown, or not supported by this implementation.
Applies to
.NET 9 en andere versies
Product | Versies |
---|---|
.NET | Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Standard | 2.1 |
- Source:
- RSA.cs
- Source:
- RSA.cs
- Source:
- RSA.cs
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 padding, 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, System::Security::Cryptography::RSASignaturePadding ^ padding);
public virtual bool VerifyData (byte[] data, int offset, int count, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding);
abstract member VerifyData : byte[] * int * int * byte[] * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.RSASignaturePadding -> bool
override this.VerifyData : byte[] * int * int * byte[] * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.RSASignaturePadding -> bool
Public Overridable Function VerifyData (data As Byte(), offset As Integer, count As Integer, signature As Byte(), hashAlgorithm As HashAlgorithmName, padding As RSASignaturePadding) 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.
- padding
- RSASignaturePadding
The padding mode.
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
.
padding
is unknown, or not supported by this implementation.
Applies to
.NET 9 en andere versies
Product | Versies |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.3, 1.4, 1.6, 2.0, 2.1 |
.NET-feedback
.NET is een open source project. Selecteer een koppeling om feedback te geven: