DSA.TryCreateSignature 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 create the DSA signature for the specified hash into the provided buffer.
public:
virtual bool TryCreateSignature(ReadOnlySpan<System::Byte> hash, Span<System::Byte> destination, [Runtime::InteropServices::Out] int % bytesWritten);
public virtual bool TryCreateSignature(ReadOnlySpan<byte> hash, Span<byte> destination, out int bytesWritten);
abstract member TryCreateSignature : ReadOnlySpan<byte> * Span<byte> * int -> bool
override this.TryCreateSignature : ReadOnlySpan<byte> * Span<byte> * int -> bool
Public Overridable Function TryCreateSignature (hash As ReadOnlySpan(Of Byte), destination As Span(Of Byte), ByRef bytesWritten As Integer) As Boolean
Parameters
- hash
- ReadOnlySpan<Byte>
The hash to sign.
- bytesWritten
- Int32
When this method returns, contains a value that indicates the number of bytes written to destination.
Returns
true if destination is large enough to receive the result; otherwise, false.
Exceptions
This instance represents only a public key.
-or-
The implementation type only supports legacy DSA (FIPS 186-2), and hash is not a 20-byte value.
-or-
Creating the signature otherwise failed.
Remarks
The default implementation of this method is to call CreateSignature(Byte[]) and copy the result to destination.
Derived types should override this method to avoid the intermediate array creation.