RSA.VerifyHash 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| VerifyHash(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding) |
通过使用指定的哈希算法和填充来确定签名中的哈希值并将其与提供的哈希值进行比较,验证数字签名是否有效。 |
| VerifyHash(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding) |
通过使用指定的哈希算法和填充来确定签名中的哈希值并将其与提供的哈希值进行比较,验证数字签名是否有效。 |
VerifyHash(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding)
- Source:
- RSA.cs
- Source:
- RSA.cs
- Source:
- RSA.cs
- Source:
- RSA.cs
- Source:
- RSA.cs
通过使用指定的哈希算法和填充来确定签名中的哈希值并将其与提供的哈希值进行比较,验证数字签名是否有效。
public:
virtual bool VerifyHash(cli::array <System::Byte> ^ hash, cli::array <System::Byte> ^ signature, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::RSASignaturePadding ^ padding);
public:
abstract bool VerifyHash(cli::array <System::Byte> ^ hash, cli::array <System::Byte> ^ signature, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::RSASignaturePadding ^ padding);
public virtual bool VerifyHash(byte[] hash, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding);
public abstract bool VerifyHash(byte[] hash, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding);
abstract member VerifyHash : byte[] * byte[] * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.RSASignaturePadding -> bool
override this.VerifyHash : byte[] * byte[] * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.RSASignaturePadding -> bool
abstract member VerifyHash : byte[] * byte[] * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.RSASignaturePadding -> bool
Public Overridable Function VerifyHash (hash As Byte(), signature As Byte(), hashAlgorithm As HashAlgorithmName, padding As RSASignaturePadding) As Boolean
Public MustOverride Function VerifyHash (hash As Byte(), signature As Byte(), hashAlgorithm As HashAlgorithmName, padding As RSASignaturePadding) As Boolean
参数
- hash
- Byte[]
已签名数据的哈希值。
- signature
- Byte[]
要验证的签名数据。
- hashAlgorithm
- HashAlgorithmName
用于创建哈希值的哈希算法。
- padding
- RSASignaturePadding
填充模式。
返回
true 如果签名有效,则为否则,为 false.
例外
派生类必须重写此方法。
hash 或 padding 为 null.
padding 此实现未知或不受支持。
适用于
VerifyHash(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding)
- Source:
- RSA.cs
- Source:
- RSA.cs
- Source:
- RSA.cs
- Source:
- RSA.cs
- Source:
- RSA.cs
通过使用指定的哈希算法和填充来确定签名中的哈希值并将其与提供的哈希值进行比较,验证数字签名是否有效。
public:
virtual bool VerifyHash(ReadOnlySpan<System::Byte> hash, ReadOnlySpan<System::Byte> signature, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::RSASignaturePadding ^ padding);
public virtual bool VerifyHash(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding);
abstract member VerifyHash : ReadOnlySpan<byte> * ReadOnlySpan<byte> * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.RSASignaturePadding -> bool
override this.VerifyHash : ReadOnlySpan<byte> * ReadOnlySpan<byte> * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.RSASignaturePadding -> bool
Public Overridable Function VerifyHash (hash As ReadOnlySpan(Of Byte), signature As ReadOnlySpan(Of Byte), hashAlgorithm As HashAlgorithmName, padding As RSASignaturePadding) As Boolean
参数
- hash
- ReadOnlySpan<Byte>
已签名数据的哈希值。
- signature
- ReadOnlySpan<Byte>
要验证的签名数据。
- hashAlgorithm
- HashAlgorithmName
用于创建哈希值的哈希算法。
- padding
- RSASignaturePadding
填充模式。
返回
true 如果签名有效,则为否则,为 false.
例外
hash 或 padding 为 null.
padding 此实现未知或不受支持。
注解
此方法的默认实现是复制并hash复制到signature新的数组和调用VerifyHash(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding)。
派生类型应重写此方法以避免创建中间数组。