RSA.SignHash 方法  
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| SignHash(Byte[], HashAlgorithmName, RSASignaturePadding) | 在派生类中重写时,使用指定的填充来计算指定的哈希值的签名。 | 
| SignHash(ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding) | 使用指定的填充计算指定的哈希值的签名。 | 
| SignHash(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding) | 使用当前密钥对哈希进行签名,并将签名写入提供的缓冲区。 | 
SignHash(Byte[], HashAlgorithmName, RSASignaturePadding)
- Source:
- RSA.cs
- Source:
- RSA.cs
- Source:
- RSA.cs
在派生类中重写时,使用指定的填充来计算指定的哈希值的签名。
public:
 virtual cli::array <System::Byte> ^ SignHash(cli::array <System::Byte> ^ hash, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::RSASignaturePadding ^ padding);public:
 abstract cli::array <System::Byte> ^ SignHash(cli::array <System::Byte> ^ hash, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::RSASignaturePadding ^ padding);public virtual byte[] SignHash(byte[] hash, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding);public abstract byte[] SignHash(byte[] hash, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding);abstract member SignHash : byte[] * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.RSASignaturePadding -> byte[]
override this.SignHash : byte[] * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.RSASignaturePadding -> byte[]abstract member SignHash : byte[] * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.RSASignaturePadding -> byte[]Public Overridable Function SignHash (hash As Byte(), hashAlgorithm As HashAlgorithmName, padding As RSASignaturePadding) As Byte()Public MustOverride Function SignHash (hash As Byte(), hashAlgorithm As HashAlgorithmName, padding As RSASignaturePadding) As Byte()参数
- hash
- Byte[]
待签名数据的哈希值。
- hashAlgorithm
- HashAlgorithmName
要用于创建数据哈希值的哈希算法。
- padding
- RSASignaturePadding
填充。
返回
指定哈希值的 RSA 签名。
例外
派生方法必须重写此方法。
              data 或 padding 为 null。
另请参阅
- TrySignHash(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding, Int32)
- SignData(Byte[], HashAlgorithmName, RSASignaturePadding)
适用于
SignHash(ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding)
- Source:
- RSA.cs
- Source:
- RSA.cs
- Source:
- RSA.cs
使用指定的填充计算指定的哈希值的签名。
public:
 cli::array <System::Byte> ^ SignHash(ReadOnlySpan<System::Byte> hash, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::RSASignaturePadding ^ padding);public byte[] SignHash(ReadOnlySpan<byte> hash, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding);member this.SignHash : ReadOnlySpan<byte> * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.RSASignaturePadding -> byte[]Public Function SignHash (hash As ReadOnlySpan(Of Byte), hashAlgorithm As HashAlgorithmName, padding As RSASignaturePadding) As Byte()参数
- hash
- ReadOnlySpan<Byte>
待签名数据的哈希值。
- hashAlgorithm
- HashAlgorithmName
用于创建 哈希的 hash哈希算法。
- padding
- RSASignaturePadding
填充模式。
返回
指定哈希值的 RSA 签名。
例外
              padding 或 hashAlgorithm的 Name 为 null。
              hashAlgorithm的 Name 是空字符串。
此实现尚未实现 或 SignHash(Byte[], HashAlgorithmName, RSASignaturePadding)之TrySignHash(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding, Int32)一。
适用于
SignHash(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding)
- Source:
- RSA.cs
- Source:
- RSA.cs
- Source:
- RSA.cs
使用当前密钥对哈希进行签名,并将签名写入提供的缓冲区。
public:
 int SignHash(ReadOnlySpan<System::Byte> hash, Span<System::Byte> destination, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::RSASignaturePadding ^ padding);public int SignHash(ReadOnlySpan<byte> hash, Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding);member this.SignHash : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.RSASignaturePadding -> intPublic Function SignHash (hash As ReadOnlySpan(Of Byte), destination As Span(Of Byte), hashAlgorithm As HashAlgorithmName, padding As RSASignaturePadding) As Integer参数
- hash
- ReadOnlySpan<Byte>
待签名数据的哈希值。
- hashAlgorithm
- HashAlgorithmName
用于创建 哈希的 hash哈希算法。
- padding
- RSASignaturePadding
填充模式。
返回
写入 destination 的总字节数。
例外
              padding 或 hashAlgorithm的 Name 为 null。
此实现尚未实现 或 SignHash(Byte[], HashAlgorithmName, RSASignaturePadding)之TrySignHash(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding, Int32)一。