SymmetricAlgorithm.TryEncryptEcb 메서드

정의

지정된 패딩 모드에서 ECB 모드를 사용하여 지정된 버퍼로 데이터를 암호화하려고 시도합니다.

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

매개 변수

plaintext
ReadOnlySpan<Byte>

암호화할 데이터입니다.

destination
Span<Byte>

암호 텍스트 데이터를 받을 버퍼입니다.

paddingMode
PaddingMode

암호 텍스트를 생성하고 암호 해독 중에 제거하는 데 사용되는 패딩 모드입니다.

bytesWritten
Int32

이 메서드가 반환되면 .에 기록 destination된 총 바이트 수가 포함됩니다.

반환

Boolean

true if destination was large enough to receive the encrypted data; otherwise, false.

예외

paddingMode 가 유효한 패딩 모드가 아닙니다.

일반 텍스트를 성공적으로 암호화할 수 없습니다.

설명

이 메서드의 동작은 .에 의해 TryEncryptEcbCore(ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32)정의됩니다.

적용 대상