Share via


SymmetricAlgorithm.TryDecryptCfb 方法

定義

嘗試使用 CFB 模式搭配指定的填補模式和意見反應大小,將數據解密至指定的緩衝區。

public bool TryDecryptCfb (ReadOnlySpan<byte> ciphertext, ReadOnlySpan<byte> iv, Span<byte> destination, out int bytesWritten, System.Security.Cryptography.PaddingMode paddingMode = System.Security.Cryptography.PaddingMode.None, int feedbackSizeInBits = 8);
member this.TryDecryptCfb : ReadOnlySpan<byte> * ReadOnlySpan<byte> * Span<byte> * int * System.Security.Cryptography.PaddingMode * int -> bool
Public Function TryDecryptCfb (ciphertext As ReadOnlySpan(Of Byte), iv As ReadOnlySpan(Of Byte), destination As Span(Of Byte), ByRef bytesWritten As Integer, Optional paddingMode As PaddingMode = System.Security.Cryptography.PaddingMode.None, Optional feedbackSizeInBits As Integer = 8) As Boolean

參數

ciphertext
ReadOnlySpan<Byte>

要解密的資料。

iv
ReadOnlySpan<Byte>

初始化向量。

destination
Span<Byte>

要接收純文字數據的緩衝區。

bytesWritten
Int32

當這個方法傳回時,包含寫入至 destination的位元組總數。

paddingMode
PaddingMode

用來產生加密文字並在解密期間移除的填補模式。

feedbackSizeInBits
Int32

以位為單位指定的意見反應大小。

傳回

true 如果 destination 夠大而無法接收解密的數據,則為 ,否則為 false

例外狀況

paddingMode 不是有效的填補模式。

-或-

feedbackSizeInBits 不是正數或表示整數位節。

iv 是不正確的長度。 呼叫端預期會傳遞完全 BlockSize 長度的初始化向量,並轉換成位元組 (BlockSize / 8) 。

無法成功解密加密文字。

-或-

feedbackSizeInBits 對演演算法無效。

備註

這個方法的行為是由 TryDecryptCfbCore(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32, Int32)定義。

適用於