RSA.TrySignHash 메서드

정의

현재 키를 통해 해시에 서명하여 제공된 버퍼에 서명을 쓰려고 합니다.

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

매개 변수

hash
ReadOnlySpan<Byte>

서명할 데이터의 해시 값입니다.

destination
Span<Byte>

RSA 서명을 받을 버퍼입니다.

hashAlgorithm
HashAlgorithmName

데이터의 해시 값을 만드는 데 사용하는 해시 알고리즘입니다.

padding
RSASignaturePadding

패딩입니다.

bytesWritten
Int32

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

반환

destination이 RSA 서명을 받을 수 있을 만큼 길면 true이고, 그렇지 않으면 false입니다.

예외

paddingnull입니다.

hashAlgorithm.Namenull 또는 Empty입니다.

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

또는

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

또는

서명을 만드는 동안 오류가 발생했습니다.

설명

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

RSA 서명 알고리즘은 항상 비트에 필요한 바이트 수와 동일한 출력을 KeySize 생성합니다.

적용 대상

추가 정보