RSA.TrySignData 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
嘗試用指定的演算法雜湊所提供的資料,並以當前金鑰簽署雜湊,將簽章寫入提供的緩衝區。
public:
virtual bool TrySignData(ReadOnlySpan<System::Byte> data, Span<System::Byte> destination, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::RSASignaturePadding ^ padding, [Runtime::InteropServices::Out] int % bytesWritten);
public virtual bool TrySignData(ReadOnlySpan<byte> data, Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding, out int bytesWritten);
abstract member TrySignData : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.RSASignaturePadding * int -> bool
override this.TrySignData : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.RSASignaturePadding * int -> bool
Public Overridable Function TrySignData (data As ReadOnlySpan(Of Byte), destination As Span(Of Byte), hashAlgorithm As HashAlgorithmName, padding As RSASignaturePadding, ByRef bytesWritten As Integer) As Boolean
參數
- data
- ReadOnlySpan<Byte>
輸入資料要雜湊和簽名。
- hashAlgorithm
- HashAlgorithmName
用來產生資料雜湊值的雜湊演算法。
- padding
- RSASignaturePadding
填充模式。
- bytesWritten
- Int32
當此方法回傳時,包含寫入 destination的總位元組數。 此參數被視為未初始化。
傳回
true如果 destination 足夠長以接收 RSA 簽名;否則,。 false
例外狀況
padding 是 null。
備註
RSA 簽章演算法總是會產生等於位 KeySize 元所需位元組數的輸出。