SymmetricAlgorithm.TryDecryptCbc 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.
Attempts to decrypt data into the specified buffer, using CBC mode with the specified padding mode.
public bool TryDecryptCbc (ReadOnlySpan<byte> ciphertext, ReadOnlySpan<byte> iv, Span<byte> destination, out int bytesWritten, System.Security.Cryptography.PaddingMode paddingMode = System.Security.Cryptography.PaddingMode.PKCS7);
member this.TryDecryptCbc : ReadOnlySpan<byte> * ReadOnlySpan<byte> * Span<byte> * int * System.Security.Cryptography.PaddingMode -> bool
Public Function TryDecryptCbc (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.PKCS7) As Boolean
Parameters
- ciphertext
- ReadOnlySpan<Byte>
The data to decrypt.
- iv
- ReadOnlySpan<Byte>
The initialization vector.
- bytesWritten
- Int32
When this method returns, contains the total number of bytes written to destination
.
- paddingMode
- PaddingMode
The padding mode used to produce the ciphertext and remove during decryption.
Returns
true
if destination
was large enough to receive the decrypted data; otherwise, false
.
Exceptions
paddingMode
is not a valid padding mode.
iv
is the incorrect length. Callers are expected to pass an initialization vector that is exactly BlockSize in length, converted to bytes (BlockSize / 8
).
The ciphertext could not be decrypted successfully.
Remarks
This method's behavior is defined by TryDecryptCbcCore(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32).
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기