SymmetricAlgorithm.TryDecryptEcb 方法

定義

嘗試使用 ECB 模式搭配指定的填補模式,將資料解密至指定的緩衝區。

public:
 bool TryDecryptEcb(ReadOnlySpan<System::Byte> ciphertext, Span<System::Byte> destination, System::Security::Cryptography::PaddingMode paddingMode, [Runtime::InteropServices::Out] int % bytesWritten);
public bool TryDecryptEcb (ReadOnlySpan<byte> ciphertext, Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, out int bytesWritten);
member this.TryDecryptEcb : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.PaddingMode * int -> bool
Public Function TryDecryptEcb (ciphertext As ReadOnlySpan(Of Byte), destination As Span(Of Byte), paddingMode As PaddingMode, ByRef bytesWritten As Integer) As Boolean

參數

ciphertext
ReadOnlySpan<Byte>

要解密的資料。

destination
Span<Byte>

要接收純文字資料的緩衝區。

paddingMode
PaddingMode

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

bytesWritten
Int32

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

傳回

true 如果 destination 夠大,無法接收解密的資料,則為 ,否則為 false

例外狀況

paddingMode 不是有效的填補模式。

無法成功解密加密文字。

備註

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

適用於