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 バイト数と同じ出力が生成されます。

適用対象

こちらもご覧ください