Share via


RSA.TryDecrypt 메서드

정의

지정된 패딩 모드를 사용하여 입력 데이터를 암호 해독하고 그 결과를 지정된 버퍼에 쓰려고 합니다.

public:
 virtual bool TryDecrypt(ReadOnlySpan<System::Byte> data, Span<System::Byte> destination, System::Security::Cryptography::RSAEncryptionPadding ^ padding, [Runtime::InteropServices::Out] int % bytesWritten);
public virtual bool TryDecrypt (ReadOnlySpan<byte> data, Span<byte> destination, System.Security.Cryptography.RSAEncryptionPadding padding, out int bytesWritten);
abstract member TryDecrypt : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.RSAEncryptionPadding * int -> bool
override this.TryDecrypt : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.RSAEncryptionPadding * int -> bool
Public Overridable Function TryDecrypt (data As ReadOnlySpan(Of Byte), destination As Span(Of Byte), padding As RSAEncryptionPadding, ByRef bytesWritten As Integer) As Boolean

매개 변수

data
ReadOnlySpan<Byte>

해독할 데이터입니다.

destination
Span<Byte>

암호 해독된 데이터를 받을 버퍼입니다.

padding
RSAEncryptionPadding

패딩 모드입니다.

bytesWritten
Int32

이 메서드가 반환될 경우 destination에 기록되는 총 바이트 수입니다. 이 매개 변수는 초기화되지 않은 것으로 처리됩니다.

반환

Boolean

destination이 암호 해독된 데이터를 받을 수 있을 만큼 긴 경우 true이고, 그렇지 않으면 false입니다.

예외

padding이(가) null인 경우

padding은 알 수 없거나 이 구현에서 지원되지 않습니다.

또는

data의 길이가 KeySize의 바이트 수와 같지 않습니다.

또는

이 인스턴스는 퍼블릭 키만 나타냅니다.

또는

암호 해독 작업에 실패했습니다.

설명

이 메서드 Decrypt(Byte[], RSAEncryptionPadding) 의 기본 구현 호출 하 고 결과를 복사 합니다 destination. 파생 형식은 중간 배열 생성을 방지하려면 이 메서드를 재정의해야 합니다.

RSA 암호 해독 알고리즘은 항상 입력보다 작은 출력을 생성하므로 이 메서드는 반환되지 않습니다 false destination.Length >= data.Length.

적용 대상

추가 정보