SymmetricAlgorithm.TryEncryptEcbCore Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
When overridden in a derived class, attempts to encrypt data into the specified buffer, using ECB mode with the specified padding mode.
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
Parameters
- plaintext
- ReadOnlySpan<Byte>
The data to encrypt.
- paddingMode
- PaddingMode
The padding mode used to produce the ciphertext and remove during decryption.
- bytesWritten
- Int32
When this method returns, contains the total number of bytes written to destination
.
Returns
true
if destination
was large enough to receive the encrypted data; otherwise, false
.
Exceptions
A derived class has not provided an implementation.
Remarks
Derived classes must override this and provide an implementation.
Implementations of this method must write precisely
GetCiphertextLengthEcb(plaintext.Length, paddingMode)
bytes to destination
and report that via bytesWritten
.
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈