RSA.SignHash 方法

定义

使用指定的填充计算指定哈希值的签名。

重载

名称 说明
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
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

填充。

返回

Byte[]

指定哈希值的 RSA 签名。

例外

派生类必须重写此方法。

hashpaddingnull.

hashAlgorithmNamenullEmpty

padding 此实现未知或不受支持。

-或-

此实例仅表示公钥。

-或-

创建签名时出错。

另请参阅

适用于

SignHash(ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding)

Source:
RSA.cs
Source:
RSA.cs
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

填充模式。

返回

Byte[]

指定哈希值的 RSA 签名。

例外

paddinghashAlgorithm's Namenull.

hashAlgorithm's Name 是空字符串。

padding 此实现未知或不受支持。

-或-

此实例仅表示公钥。

-或-

创建签名时出错。

适用于

SignHash(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding)

Source:
RSA.cs
Source:
RSA.cs
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 -> int
Public Function SignHash (hash As ReadOnlySpan(Of Byte), destination As Span(Of Byte), hashAlgorithm As HashAlgorithmName, padding As RSASignaturePadding) As Integer

参数

hash
ReadOnlySpan<Byte>

要签名的数据的哈希值。

destination
Span<Byte>

要接收 RSA 签名的缓冲区。

hashAlgorithm
HashAlgorithmName

用于创建其哈希的 hash哈希算法。

padding
RSASignaturePadding

填充模式。

返回

写入到 destination的字节总数。

例外

paddinghashAlgorithm's Namenull.

hashAlgorithm's Name 是空字符串。

-或-

缓冲区 destination 太小,无法保存签名。

padding 此实现未知或不受支持。

-或-

此实例仅表示公钥。

-或-

创建签名时出错。

适用于