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
。