SymmetricAlgorithm.TryEncryptEcbCore 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
當在派生類別中覆寫時,會嘗試將資料加密到指定的緩衝區,使用 ECB 模式並搭配指定的填充模式。
protected:
virtual bool TryEncryptEcbCore(ReadOnlySpan<System::Byte> plaintext, Span<System::Byte> destination, System::Security::Cryptography::PaddingMode paddingMode, [Runtime::InteropServices::Out] int % bytesWritten);
protected virtual bool TryEncryptEcbCore(ReadOnlySpan<byte> plaintext, Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, out int bytesWritten);
abstract member TryEncryptEcbCore : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.PaddingMode * int -> bool
override this.TryEncryptEcbCore : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.PaddingMode * int -> bool
Protected Overridable Function TryEncryptEcbCore (plaintext As ReadOnlySpan(Of Byte), destination As Span(Of Byte), paddingMode As PaddingMode, ByRef bytesWritten As Integer) As Boolean
參數
- plaintext
- ReadOnlySpan<Byte>
要加密的資料。
- paddingMode
- PaddingMode
填充模式用於產生密文並在解密時移除。
- bytesWritten
- Int32
當此方法回傳時,包含寫入 destination的總位元組數。
傳回
true 如果 destination 足夠大以接收加密資料;否則, false。
例外狀況
派生類別尚未提供實作。
備註
衍生類別必須覆蓋此限制並提供實作。
此方法的實作必須精確GetCiphertextLengthEcb(plaintext.Length, paddingMode)地寫入位destination元組,並透過 來報告。bytesWritten