[#CKey-Sign]
= xref:CKey.adoc[CKey]::Sign
:relfileprefix: ../
:mrdocs:

Create a DER&hyphen;serialized signature&period; The test&lowbar;case parameter tweaks the deterministic nonce&period;

== Synopsis

Declared in `&lt;key&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
Sign(
    xref:uint256.adoc[uint256] const& hash,
    std::vector&lt;unsigned char&gt;& vchSig,
    bool grind = true,
    uint32&lowbar;t test&lowbar;case = 0) const;
----

== Return Value

true if signing succeeded&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *hash*
| The 32&hyphen;byte message hash to sign&period;
| *vchSig*
| Output buffer receiving the DER&hyphen;serialized signature&period;
| *grind*
| Whether to grind the nonce for a small (low&hyphen;R) signature&period;
| *test&lowbar;case*
| Tweaks the deterministic nonce (for testing)&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
