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