RSA.SignData 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
計算指定資料的雜湊值並簽名。
多載
| 名稱 | Description |
|---|---|
| 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)
- 來源:
- RSA.cs
- 來源:
- RSA.cs
- 來源:
- RSA.cs
- 來源:
- RSA.cs
- 來源:
- 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)
- 來源:
- RSA.cs
- 來源:
- RSA.cs
- 來源:
- RSA.cs
- 來源:
- RSA.cs
- 來源:
- 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)
- 來源:
- RSA.cs
- 來源:
- RSA.cs
- 來源:
- RSA.cs
- 來源:
- RSA.cs
- 來源:
- 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是 Namenull。
hashAlgorithm是 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)
- 來源:
- RSA.cs
- 來源:
- RSA.cs
- 來源:
- RSA.cs
- 來源:
- RSA.cs
- 來源:
- 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是 Namenull。
此實作未實作其中之一 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)
- 來源:
- RSA.cs
- 來源:
- RSA.cs
- 來源:
- RSA.cs
- 來源:
- RSA.cs
- 來源:
- 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)