Share via


SymmetricAlgorithm.TryEncryptCfbCore 方法

定义

在派生类中重写时,尝试使用具有指定填充模式和反馈大小的 CFB 模式将数据加密到指定的缓冲区中。

protected:
 virtual bool TryEncryptCfbCore(ReadOnlySpan<System::Byte> plaintext, ReadOnlySpan<System::Byte> iv, Span<System::Byte> destination, System::Security::Cryptography::PaddingMode paddingMode, int feedbackSizeInBits, [Runtime::InteropServices::Out] int % bytesWritten);
protected virtual bool TryEncryptCfbCore (ReadOnlySpan<byte> plaintext, ReadOnlySpan<byte> iv, Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, int feedbackSizeInBits, out int bytesWritten);
abstract member TryEncryptCfbCore : ReadOnlySpan<byte> * ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.PaddingMode * int * int -> bool
override this.TryEncryptCfbCore : ReadOnlySpan<byte> * ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.PaddingMode * int * int -> bool
Protected Overridable Function TryEncryptCfbCore (plaintext As ReadOnlySpan(Of Byte), iv As ReadOnlySpan(Of Byte), destination As Span(Of Byte), paddingMode As PaddingMode, feedbackSizeInBits As Integer, ByRef bytesWritten As Integer) As Boolean

参数

plaintext
ReadOnlySpan<Byte>

要加密的数据。

iv
ReadOnlySpan<Byte>

初始化向量。

destination
Span<Byte>

用于接收密码文本数据的缓冲区。

paddingMode
PaddingMode

用于在解密期间生成密码文本和删除的填充模式。

feedbackSizeInBits
Int32

以位为单位指定的反馈大小。

bytesWritten
Int32

此方法返回时,包含写入到 destination的字节总数。

返回

true 如果 destination 大到足以接收加密数据,则为 ;否则为 false

例外

派生类未提供实现。

注解

派生类必须重写此值并提供实现。

此方法的实现必须精确写入GetCiphertextLengthCfb(plaintext.Length, paddingMode, feedbackSizeInBits) 字节到 destination ,并通过 bytesWritten进行报告。

适用于