RSACng.TryEncrypt 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
使用公鑰加密資料。
public:
override bool TryEncrypt(ReadOnlySpan<System::Byte> data, Span<System::Byte> destination, System::Security::Cryptography::RSAEncryptionPadding ^ padding, [Runtime::InteropServices::Out] int % bytesWritten);
public override bool TryEncrypt(ReadOnlySpan<byte> data, Span<byte> destination, System.Security.Cryptography.RSAEncryptionPadding padding, out int bytesWritten);
override this.TryEncrypt : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.RSAEncryptionPadding * int -> bool
Public Overrides Function TryEncrypt (data As ReadOnlySpan(Of Byte), destination As Span(Of Byte), padding As RSAEncryptionPadding, ByRef bytesWritten As Integer) As Boolean
參數
- data
- ReadOnlySpan<Byte>
要加密的資料。
- padding
- RSAEncryptionPadding
填充模式。
- bytesWritten
- Int32
當此方法回傳時,包含寫入 destination的總位元組數。 此參數被視為未初始化。
傳回
true 如果 destination 足夠長以接收加密資料;否則, false。