mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 09:46:12 +00:00
971 lines
49 KiB
HTML
971 lines
49 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.14"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>Dash Core: CKey Class Reference</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript" src="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(document).ready(initResizable);
|
|
/* @license-end */</script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectlogo"><img alt="Logo" src="bitcoin_logo_doxygen.png"/></td>
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">Dash Core
|
|
 <span id="projectnumber">0.12.2.1</span>
|
|
</div>
|
|
<div id="projectbrief">P2P Digital Currency</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.14 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(document).ready(function(){initNavTree('classCKey.html','');});
|
|
/* @license-end */
|
|
</script>
|
|
<div id="doc-content">
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="#pub-static-methods">Static Public Member Functions</a> |
|
|
<a href="#pri-static-methods">Static Private Member Functions</a> |
|
|
<a href="#pri-attribs">Private Attributes</a> |
|
|
<a href="#friends">Friends</a> |
|
|
<a href="classCKey-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">CKey Class Reference</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p><code>#include <<a class="el" href="key_8h_source.html">key.h</a>></code></p>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
|
|
Public Member Functions</h2></td></tr>
|
|
<tr class="memitem:a8f4ca910c7b7e729a3f2a5c59d060d3d"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classCKey.html#a8f4ca910c7b7e729a3f2a5c59d060d3d">CKey</a> ()</td></tr>
|
|
<tr class="memdesc:a8f4ca910c7b7e729a3f2a5c59d060d3d"><td class="mdescLeft"> </td><td class="mdescRight">Construct an invalid private key. <a href="#a8f4ca910c7b7e729a3f2a5c59d060d3d">More...</a><br /></td></tr>
|
|
<tr class="separator:a8f4ca910c7b7e729a3f2a5c59d060d3d"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:afcea34cefd25675f4cf9b03eaa4bb7d9"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classCKey.html#afcea34cefd25675f4cf9b03eaa4bb7d9">CKey</a> (const <a class="el" href="classCKey.html">CKey</a> &secret)</td></tr>
|
|
<tr class="memdesc:afcea34cefd25675f4cf9b03eaa4bb7d9"><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor. This is necessary because of memlocking. <a href="#afcea34cefd25675f4cf9b03eaa4bb7d9">More...</a><br /></td></tr>
|
|
<tr class="separator:afcea34cefd25675f4cf9b03eaa4bb7d9"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a57d5b254748cef054c40f99c1c339147"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classCKey.html#a57d5b254748cef054c40f99c1c339147">~CKey</a> ()</td></tr>
|
|
<tr class="memdesc:a57d5b254748cef054c40f99c1c339147"><td class="mdescLeft"> </td><td class="mdescRight">Destructor (again necessary because of memlocking). <a href="#a57d5b254748cef054c40f99c1c339147">More...</a><br /></td></tr>
|
|
<tr class="separator:a57d5b254748cef054c40f99c1c339147"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aaa13d5f08456bba094210c5eeabf64c8"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
|
<tr class="memitem:aaa13d5f08456bba094210c5eeabf64c8"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classCKey.html#aaa13d5f08456bba094210c5eeabf64c8">Set</a> (const T pbegin, const T pend, bool fCompressedIn)</td></tr>
|
|
<tr class="memdesc:aaa13d5f08456bba094210c5eeabf64c8"><td class="mdescLeft"> </td><td class="mdescRight">Initialize using begin and end iterators to byte data. <a href="#aaa13d5f08456bba094210c5eeabf64c8">More...</a><br /></td></tr>
|
|
<tr class="separator:aaa13d5f08456bba094210c5eeabf64c8"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a468a9a8cd148ab4a43e7d76bbdc78abe"><td class="memItemLeft" align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="classCKey.html#a468a9a8cd148ab4a43e7d76bbdc78abe">size</a> () const</td></tr>
|
|
<tr class="memdesc:a468a9a8cd148ab4a43e7d76bbdc78abe"><td class="mdescLeft"> </td><td class="mdescRight">Simple read-only vector-like interface. <a href="#a468a9a8cd148ab4a43e7d76bbdc78abe">More...</a><br /></td></tr>
|
|
<tr class="separator:a468a9a8cd148ab4a43e7d76bbdc78abe"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ab8dee0ad9d933304a22284ee40040847"><td class="memItemLeft" align="right" valign="top">const unsigned char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classCKey.html#ab8dee0ad9d933304a22284ee40040847">begin</a> () const</td></tr>
|
|
<tr class="separator:ab8dee0ad9d933304a22284ee40040847"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a41c700c4a732672e4b7cc60d811dbf41"><td class="memItemLeft" align="right" valign="top">const unsigned char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classCKey.html#a41c700c4a732672e4b7cc60d811dbf41">end</a> () const</td></tr>
|
|
<tr class="separator:a41c700c4a732672e4b7cc60d811dbf41"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a56e06c48d504a1a65e244e5fc35cdecc"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classCKey.html#a56e06c48d504a1a65e244e5fc35cdecc">IsValid</a> () const</td></tr>
|
|
<tr class="memdesc:a56e06c48d504a1a65e244e5fc35cdecc"><td class="mdescLeft"> </td><td class="mdescRight">Check whether this private key is valid. <a href="#a56e06c48d504a1a65e244e5fc35cdecc">More...</a><br /></td></tr>
|
|
<tr class="separator:a56e06c48d504a1a65e244e5fc35cdecc"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a96b017433a65335775cf3807d73f85ce"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classCKey.html#a96b017433a65335775cf3807d73f85ce">IsCompressed</a> () const</td></tr>
|
|
<tr class="memdesc:a96b017433a65335775cf3807d73f85ce"><td class="mdescLeft"> </td><td class="mdescRight">Check whether the public key corresponding to this private key is (to be) compressed. <a href="#a96b017433a65335775cf3807d73f85ce">More...</a><br /></td></tr>
|
|
<tr class="separator:a96b017433a65335775cf3807d73f85ce"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aa62c082c9037565fce02b457cc335e7b"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classCKey.html#aa62c082c9037565fce02b457cc335e7b">SetPrivKey</a> (const <a class="el" href="key_8h.html#a1da569b8b6e5b3fa1196cc1b877e7f54">CPrivKey</a> &vchPrivKey, bool <a class="el" href="classCKey.html#a9e5f8cac8811466c735d7af6f17a0dfe">fCompressed</a>)</td></tr>
|
|
<tr class="memdesc:aa62c082c9037565fce02b457cc335e7b"><td class="mdescLeft"> </td><td class="mdescRight">Initialize from a CPrivKey (serialized OpenSSL private key data). <a href="#aa62c082c9037565fce02b457cc335e7b">More...</a><br /></td></tr>
|
|
<tr class="separator:aa62c082c9037565fce02b457cc335e7b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a9d12ed9d297e4286250fd7ea6b59e1a5"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classCKey.html#a9d12ed9d297e4286250fd7ea6b59e1a5">MakeNewKey</a> (bool <a class="el" href="classCKey.html#a9e5f8cac8811466c735d7af6f17a0dfe">fCompressed</a>)</td></tr>
|
|
<tr class="memdesc:a9d12ed9d297e4286250fd7ea6b59e1a5"><td class="mdescLeft"> </td><td class="mdescRight">Generate a new private key using a cryptographic PRNG. <a href="#a9d12ed9d297e4286250fd7ea6b59e1a5">More...</a><br /></td></tr>
|
|
<tr class="separator:a9d12ed9d297e4286250fd7ea6b59e1a5"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a91b6ecf71cc16e0b05ce79ec9276e729"><td class="memItemLeft" align="right" valign="top"><a class="el" href="key_8h.html#a1da569b8b6e5b3fa1196cc1b877e7f54">CPrivKey</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classCKey.html#a91b6ecf71cc16e0b05ce79ec9276e729">GetPrivKey</a> () const</td></tr>
|
|
<tr class="separator:a91b6ecf71cc16e0b05ce79ec9276e729"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aa1085c59603a62db6ec776300f250337"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classCPubKey.html">CPubKey</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classCKey.html#aa1085c59603a62db6ec776300f250337">GetPubKey</a> () const</td></tr>
|
|
<tr class="separator:aa1085c59603a62db6ec776300f250337"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aa9b184a4a71d3e1a40aab360cf68e86c"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classCKey.html#aa9b184a4a71d3e1a40aab360cf68e86c">Sign</a> (const <a class="el" href="classuint256.html">uint256</a> &hash, std::vector< unsigned char > &vchSig, uint32_t test_case=0) const</td></tr>
|
|
<tr class="separator:aa9b184a4a71d3e1a40aab360cf68e86c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:afe77d80889aa68e92e6882e75424cfb8"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classCKey.html#afe77d80889aa68e92e6882e75424cfb8">SignCompact</a> (const <a class="el" href="classuint256.html">uint256</a> &hash, std::vector< unsigned char > &vchSig) const</td></tr>
|
|
<tr class="separator:afe77d80889aa68e92e6882e75424cfb8"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ae79008cec2eb799a2efd37e010996acf"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classCKey.html#ae79008cec2eb799a2efd37e010996acf">Derive</a> (<a class="el" href="classCKey.html">CKey</a> &keyChild, <a class="el" href="hash_8h.html#aa201a9867f780a040c7af908e0a85db3">ChainCode</a> &ccChild, unsigned int nChild, const <a class="el" href="hash_8h.html#aa201a9867f780a040c7af908e0a85db3">ChainCode</a> &cc) const</td></tr>
|
|
<tr class="memdesc:ae79008cec2eb799a2efd37e010996acf"><td class="mdescLeft"> </td><td class="mdescRight">Derive BIP32 child key. <a href="#ae79008cec2eb799a2efd37e010996acf">More...</a><br /></td></tr>
|
|
<tr class="separator:ae79008cec2eb799a2efd37e010996acf"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac53425b8d0f89067bce781c485101b20"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classCKey.html#ac53425b8d0f89067bce781c485101b20">VerifyPubKey</a> (const <a class="el" href="classCPubKey.html">CPubKey</a> &vchPubKey) const</td></tr>
|
|
<tr class="separator:ac53425b8d0f89067bce781c485101b20"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a141751588f8bfe5f1b6fc27f4e64b63f"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classCKey.html#a141751588f8bfe5f1b6fc27f4e64b63f">Load</a> (<a class="el" href="key_8h.html#a1da569b8b6e5b3fa1196cc1b877e7f54">CPrivKey</a> &privkey, <a class="el" href="classCPubKey.html">CPubKey</a> &vchPubKey, bool fSkipCheck)</td></tr>
|
|
<tr class="memdesc:a141751588f8bfe5f1b6fc27f4e64b63f"><td class="mdescLeft"> </td><td class="mdescRight">Load private key and check that public key matches. <a href="#a141751588f8bfe5f1b6fc27f4e64b63f">More...</a><br /></td></tr>
|
|
<tr class="separator:a141751588f8bfe5f1b6fc27f4e64b63f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
|
|
Static Public Member Functions</h2></td></tr>
|
|
<tr class="memitem:a625c363d9adfbd4dda22f3a67a898cf4"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classCKey.html#a625c363d9adfbd4dda22f3a67a898cf4">CheckSignatureElement</a> (const unsigned char *<a class="el" href="classCKey.html#a07f9e2b043670dfbaa9b7b4e782ed116">vch</a>, int len, bool half)</td></tr>
|
|
<tr class="memdesc:a625c363d9adfbd4dda22f3a67a898cf4"><td class="mdescLeft"> </td><td class="mdescRight">Check whether an element of a signature (r or s) is valid. <a href="#a625c363d9adfbd4dda22f3a67a898cf4">More...</a><br /></td></tr>
|
|
<tr class="separator:a625c363d9adfbd4dda22f3a67a898cf4"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-static-methods"></a>
|
|
Static Private Member Functions</h2></td></tr>
|
|
<tr class="memitem:acec869bc75fa8f4d619ab025d367a97c"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classCKey.html#acec869bc75fa8f4d619ab025d367a97c">Check</a> (const unsigned char *<a class="el" href="classCKey.html#a07f9e2b043670dfbaa9b7b4e782ed116">vch</a>)</td></tr>
|
|
<tr class="memdesc:acec869bc75fa8f4d619ab025d367a97c"><td class="mdescLeft"> </td><td class="mdescRight">Check whether the 32-byte array pointed to be vch is valid keydata. <a href="#acec869bc75fa8f4d619ab025d367a97c">More...</a><br /></td></tr>
|
|
<tr class="separator:acec869bc75fa8f4d619ab025d367a97c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
|
|
Private Attributes</h2></td></tr>
|
|
<tr class="memitem:a78cdd7f831519b5167f6c801f49fa977"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classCKey.html#a78cdd7f831519b5167f6c801f49fa977">fValid</a></td></tr>
|
|
<tr class="separator:a78cdd7f831519b5167f6c801f49fa977"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a9e5f8cac8811466c735d7af6f17a0dfe"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classCKey.html#a9e5f8cac8811466c735d7af6f17a0dfe">fCompressed</a></td></tr>
|
|
<tr class="memdesc:a9e5f8cac8811466c735d7af6f17a0dfe"><td class="mdescLeft"> </td><td class="mdescRight">Whether the public key corresponding to this private key is (to be) compressed. <a href="#a9e5f8cac8811466c735d7af6f17a0dfe">More...</a><br /></td></tr>
|
|
<tr class="separator:a9e5f8cac8811466c735d7af6f17a0dfe"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a07f9e2b043670dfbaa9b7b4e782ed116"><td class="memItemLeft" align="right" valign="top">unsigned char </td><td class="memItemRight" valign="bottom"><a class="el" href="classCKey.html#a07f9e2b043670dfbaa9b7b4e782ed116">vch</a> [32]</td></tr>
|
|
<tr class="memdesc:a07f9e2b043670dfbaa9b7b4e782ed116"><td class="mdescLeft"> </td><td class="mdescRight">The actual byte data. <a href="#a07f9e2b043670dfbaa9b7b4e782ed116">More...</a><br /></td></tr>
|
|
<tr class="separator:a07f9e2b043670dfbaa9b7b4e782ed116"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
|
|
Friends</h2></td></tr>
|
|
<tr class="memitem:a381efd9184dc467e73e690329c70371d"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classCKey.html#a381efd9184dc467e73e690329c70371d">operator==</a> (const <a class="el" href="classCKey.html">CKey</a> &a, const <a class="el" href="classCKey.html">CKey</a> &b)</td></tr>
|
|
<tr class="separator:a381efd9184dc467e73e690329c70371d"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><p>An encapsulated private key. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8h_source.html#l00035">35</a> of file <a class="el" href="key_8h_source.html">key.h</a>.</p>
|
|
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
|
<a id="a8f4ca910c7b7e729a3f2a5c59d060d3d"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a8f4ca910c7b7e729a3f2a5c59d060d3d">◆ </a></span>CKey() <span class="overload">[1/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">CKey::CKey </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Construct an invalid private key. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8h_source.html#l00053">53</a> of file <a class="el" href="key_8h_source.html">key.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="afcea34cefd25675f4cf9b03eaa4bb7d9"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#afcea34cefd25675f4cf9b03eaa4bb7d9">◆ </a></span>CKey() <span class="overload">[2/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">CKey::CKey </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classCKey.html">CKey</a> & </td>
|
|
<td class="paramname"><em>secret</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Copy constructor. This is necessary because of memlocking. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8h_source.html#l00059">59</a> of file <a class="el" href="key_8h_source.html">key.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a57d5b254748cef054c40f99c1c339147"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a57d5b254748cef054c40f99c1c339147">◆ </a></span>~CKey()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">CKey::~CKey </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Destructor (again necessary because of memlocking). </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8h_source.html#l00066">66</a> of file <a class="el" href="key_8h_source.html">key.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Function Documentation</h2>
|
|
<a id="ab8dee0ad9d933304a22284ee40040847"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ab8dee0ad9d933304a22284ee40040847">◆ </a></span>begin()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const unsigned char* CKey::begin </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8h_source.html#l00096">96</a> of file <a class="el" href="key_8h_source.html">key.h</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="key_8cpp_source.html#l00225">Derive()</a>, <a class="el" href="key_8cpp_source.html#l00278">CExtKey::Encode()</a>, <a class="el" href="key_8cpp_source.html#l00143">GetPrivKey()</a>, <a class="el" href="key_8cpp_source.html#l00156">GetPubKey()</a>, <a class="el" href="key_8cpp_source.html#l00213">Load()</a>, <a class="el" href="base58_8cpp_source.html#l00306">CBitcoinSecret::SetKey()</a>, <a class="el" href="key_8cpp_source.html#l00135">SetPrivKey()</a>, <a class="el" href="key_8cpp_source.html#l00169">Sign()</a>, and <a class="el" href="key_8cpp_source.html#l00198">SignCompact()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="acec869bc75fa8f4d619ab025d367a97c"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#acec869bc75fa8f4d619ab025d367a97c">◆ </a></span>Check()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool CKey::Check </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const unsigned char * </td>
|
|
<td class="paramname"><em>vch</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">private</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Check whether the 32-byte array pointed to be vch is valid keydata. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8cpp_source.html#l00122">122</a> of file <a class="el" href="key_8cpp_source.html">key.cpp</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="key_8cpp_source.html#l00126">MakeNewKey()</a>, and <a class="el" href="key_8h_source.html#l00079">Set()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a625c363d9adfbd4dda22f3a67a898cf4"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a625c363d9adfbd4dda22f3a67a898cf4">◆ </a></span>CheckSignatureElement()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">static bool CKey::CheckSignatureElement </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const unsigned char * </td>
|
|
<td class="paramname"><em>vch</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"><em>len</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>half</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Check whether an element of a signature (r or s) is valid. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ae79008cec2eb799a2efd37e010996acf"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ae79008cec2eb799a2efd37e010996acf">◆ </a></span>Derive()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool CKey::Derive </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classCKey.html">CKey</a> & </td>
|
|
<td class="paramname"><em>keyChild</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="hash_8h.html#aa201a9867f780a040c7af908e0a85db3">ChainCode</a> & </td>
|
|
<td class="paramname"><em>ccChild</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned int </td>
|
|
<td class="paramname"><em>nChild</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const <a class="el" href="hash_8h.html#aa201a9867f780a040c7af908e0a85db3">ChainCode</a> & </td>
|
|
<td class="paramname"><em>cc</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Derive BIP32 child key. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8cpp_source.html#l00225">225</a> of file <a class="el" href="key_8cpp_source.html">key.cpp</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="key_8cpp_source.html#l00247">CExtKey::Derive()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a41c700c4a732672e4b7cc60d811dbf41"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a41c700c4a732672e4b7cc60d811dbf41">◆ </a></span>end()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const unsigned char* CKey::end </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8h_source.html#l00097">97</a> of file <a class="el" href="key_8h_source.html">key.h</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="key_8cpp_source.html#l00225">Derive()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a91b6ecf71cc16e0b05ce79ec9276e729"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a91b6ecf71cc16e0b05ce79ec9276e729">◆ </a></span>GetPrivKey()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="key_8h.html#a1da569b8b6e5b3fa1196cc1b877e7f54">CPrivKey</a> CKey::GetPrivKey </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Convert the private key to a CPrivKey (serialized OpenSSL private key data). This is expensive. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8cpp_source.html#l00143">143</a> of file <a class="el" href="key_8cpp_source.html">key.cpp</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="wallet_8cpp_source.html#l00288">CWallet::AddKeyPubKey()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aa1085c59603a62db6ec776300f250337"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aa1085c59603a62db6ec776300f250337">◆ </a></span>GetPubKey()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classCPubKey.html">CPubKey</a> CKey::GetPubKey </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Compute the public key from a private key. This is expensive. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8cpp_source.html#l00156">156</a> of file <a class="el" href="key_8cpp_source.html">key.cpp</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="key_8cpp_source.html#l00225">Derive()</a>, <a class="el" href="key_8cpp_source.html#l00247">CExtKey::Derive()</a>, <a class="el" href="wallet_8cpp_source.html#l00140">CWallet::DeriveNewChildKey()</a>, <a class="el" href="wallet_8cpp_source.html#l00103">CWallet::GenerateNewKey()</a>, <a class="el" href="messagesigner_8cpp_source.html#l00012">CMessageSigner::GetKeysFromSecret()</a>, <a class="el" href="wallet_8cpp_source.html#l03015">CWallet::GetOutpointAndKeysFromOutput()</a>, and <a class="el" href="key_8cpp_source.html#l00268">CExtKey::Neuter()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a96b017433a65335775cf3807d73f85ce"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a96b017433a65335775cf3807d73f85ce">◆ </a></span>IsCompressed()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool CKey::IsCompressed </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Check whether the public key corresponding to this private key is (to be) compressed. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8h_source.html#l00103">103</a> of file <a class="el" href="key_8h_source.html">key.h</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="key_8cpp_source.html#l00225">Derive()</a>, and <a class="el" href="base58_8cpp_source.html#l00306">CBitcoinSecret::SetKey()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a56e06c48d504a1a65e244e5fc35cdecc"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a56e06c48d504a1a65e244e5fc35cdecc">◆ </a></span>IsValid()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool CKey::IsValid </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Check whether this private key is valid. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8h_source.html#l00100">100</a> of file <a class="el" href="key_8h_source.html">key.h</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="key_8cpp_source.html#l00225">Derive()</a>, and <a class="el" href="base58_8cpp_source.html#l00306">CBitcoinSecret::SetKey()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a141751588f8bfe5f1b6fc27f4e64b63f"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a141751588f8bfe5f1b6fc27f4e64b63f">◆ </a></span>Load()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool CKey::Load </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="key_8h.html#a1da569b8b6e5b3fa1196cc1b877e7f54">CPrivKey</a> & </td>
|
|
<td class="paramname"><em>privkey</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="classCPubKey.html">CPubKey</a> & </td>
|
|
<td class="paramname"><em>vchPubKey</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>fSkipCheck</em> = <code>false</code> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Load private key and check that public key matches. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8cpp_source.html#l00213">213</a> of file <a class="el" href="key_8cpp_source.html">key.cpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a9d12ed9d297e4286250fd7ea6b59e1a5"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a9d12ed9d297e4286250fd7ea6b59e1a5">◆ </a></span>MakeNewKey()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void CKey::MakeNewKey </td>
|
|
<td>(</td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>fCompressed</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Generate a new private key using a cryptographic PRNG. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8cpp_source.html#l00126">126</a> of file <a class="el" href="key_8cpp_source.html">key.cpp</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="wallet_8cpp_source.html#l00103">CWallet::GenerateNewKey()</a>, and <a class="el" href="rpc_2masternode_8cpp_source.html#l00096">masternode()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aaa13d5f08456bba094210c5eeabf64c8"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aaa13d5f08456bba094210c5eeabf64c8">◆ </a></span>Set()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename T > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void CKey::Set </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const T </td>
|
|
<td class="paramname"><em>pbegin</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const T </td>
|
|
<td class="paramname"><em>pend</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>fCompressedIn</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Initialize using begin and end iterators to byte data. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8h_source.html#l00079">79</a> of file <a class="el" href="key_8h_source.html">key.h</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="key_8cpp_source.html#l00289">CExtKey::Decode()</a>, <a class="el" href="base58_8cpp_source.html#l00314">CBitcoinSecret::GetKey()</a>, and <a class="el" href="key_8cpp_source.html#l00255">CExtKey::SetMaster()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aa62c082c9037565fce02b457cc335e7b"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aa62c082c9037565fce02b457cc335e7b">◆ </a></span>SetPrivKey()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool CKey::SetPrivKey </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="key_8h.html#a1da569b8b6e5b3fa1196cc1b877e7f54">CPrivKey</a> & </td>
|
|
<td class="paramname"><em>vchPrivKey</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>fCompressed</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Initialize from a CPrivKey (serialized OpenSSL private key data). </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8cpp_source.html#l00135">135</a> of file <a class="el" href="key_8cpp_source.html">key.cpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aa9b184a4a71d3e1a40aab360cf68e86c"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aa9b184a4a71d3e1a40aab360cf68e86c">◆ </a></span>Sign()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool CKey::Sign </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classuint256.html">uint256</a> & </td>
|
|
<td class="paramname"><em>hash</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">std::vector< unsigned char > & </td>
|
|
<td class="paramname"><em>vchSig</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint32_t </td>
|
|
<td class="paramname"><em>test_case</em> = <code>0</code> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Create a DER-serialized signature. The test_case parameter tweaks the deterministic nonce. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8cpp_source.html#l00169">169</a> of file <a class="el" href="key_8cpp_source.html">key.cpp</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="key_8cpp_source.html#l00184">VerifyPubKey()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="afe77d80889aa68e92e6882e75424cfb8"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#afe77d80889aa68e92e6882e75424cfb8">◆ </a></span>SignCompact()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool CKey::SignCompact </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classuint256.html">uint256</a> & </td>
|
|
<td class="paramname"><em>hash</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">std::vector< unsigned char > & </td>
|
|
<td class="paramname"><em>vchSig</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Create a compact signature (65 bytes), which allows reconstructing the used public key. The format is one header byte, followed by two times 32 bytes for the serialized r and s values. The header byte: 0x1B = first key with even y, 0x1C = first key with odd y, 0x1D = second key with even y, 0x1E = second key with odd y, add 0x04 for compressed keys. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8cpp_source.html#l00198">198</a> of file <a class="el" href="key_8cpp_source.html">key.cpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a468a9a8cd148ab4a43e7d76bbdc78abe"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a468a9a8cd148ab4a43e7d76bbdc78abe">◆ </a></span>size()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">unsigned int CKey::size </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Simple read-only vector-like interface. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8h_source.html#l00095">95</a> of file <a class="el" href="key_8h_source.html">key.h</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="key_8cpp_source.html#l00278">CExtKey::Encode()</a>, <a class="el" href="key_8h_source.html#l00097">end()</a>, and <a class="el" href="base58_8cpp_source.html#l00306">CBitcoinSecret::SetKey()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ac53425b8d0f89067bce781c485101b20"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ac53425b8d0f89067bce781c485101b20">◆ </a></span>VerifyPubKey()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool CKey::VerifyPubKey </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classCPubKey.html">CPubKey</a> & </td>
|
|
<td class="paramname"><em>vchPubKey</em></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Verify thoroughly whether a private key and a public key match. This is done using a different mechanism than just regenerating it. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8cpp_source.html#l00184">184</a> of file <a class="el" href="key_8cpp_source.html">key.cpp</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="wallet_8cpp_source.html#l00140">CWallet::DeriveNewChildKey()</a>, <a class="el" href="wallet_8cpp_source.html#l00103">CWallet::GenerateNewKey()</a>, and <a class="el" href="key_8cpp_source.html#l00213">Load()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Friends And Related Function Documentation</h2>
|
|
<a id="a381efd9184dc467e73e690329c70371d"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a381efd9184dc467e73e690329c70371d">◆ </a></span>operator==</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool operator== </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classCKey.html">CKey</a> & </td>
|
|
<td class="paramname"><em>a</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const <a class="el" href="classCKey.html">CKey</a> & </td>
|
|
<td class="paramname"><em>b</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">friend</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8h_source.html#l00071">71</a> of file <a class="el" href="key_8h_source.html">key.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Data Documentation</h2>
|
|
<a id="a9e5f8cac8811466c735d7af6f17a0dfe"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a9e5f8cac8811466c735d7af6f17a0dfe">◆ </a></span>fCompressed</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool CKey::fCompressed</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Whether the public key corresponding to this private key is (to be) compressed. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8h_source.html#l00043">43</a> of file <a class="el" href="key_8h_source.html">key.h</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="key_8cpp_source.html#l00225">Derive()</a>, <a class="el" href="key_8cpp_source.html#l00143">GetPrivKey()</a>, <a class="el" href="key_8cpp_source.html#l00156">GetPubKey()</a>, <a class="el" href="key_8h_source.html#l00103">IsCompressed()</a>, <a class="el" href="key_8cpp_source.html#l00213">Load()</a>, <a class="el" href="key_8cpp_source.html#l00126">MakeNewKey()</a>, <a class="el" href="key_8h_source.html#l00079">Set()</a>, <a class="el" href="key_8cpp_source.html#l00135">SetPrivKey()</a>, <a class="el" href="key_8cpp_source.html#l00198">SignCompact()</a>, and <a class="el" href="key_8cpp_source.html#l00184">VerifyPubKey()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a78cdd7f831519b5167f6c801f49fa977"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a78cdd7f831519b5167f6c801f49fa977">◆ </a></span>fValid</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool CKey::fValid</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Whether this private key is valid. We check for correctness when modifying the key data, so fValid should always correspond to the actual state. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8h_source.html#l00040">40</a> of file <a class="el" href="key_8h_source.html">key.h</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="key_8cpp_source.html#l00225">Derive()</a>, <a class="el" href="key_8cpp_source.html#l00143">GetPrivKey()</a>, <a class="el" href="key_8cpp_source.html#l00156">GetPubKey()</a>, <a class="el" href="key_8h_source.html#l00100">IsValid()</a>, <a class="el" href="key_8cpp_source.html#l00213">Load()</a>, <a class="el" href="key_8cpp_source.html#l00126">MakeNewKey()</a>, <a class="el" href="key_8h_source.html#l00079">Set()</a>, <a class="el" href="key_8cpp_source.html#l00135">SetPrivKey()</a>, <a class="el" href="key_8cpp_source.html#l00169">Sign()</a>, <a class="el" href="key_8cpp_source.html#l00198">SignCompact()</a>, and <a class="el" href="key_8h_source.html#l00095">size()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a07f9e2b043670dfbaa9b7b4e782ed116"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a07f9e2b043670dfbaa9b7b4e782ed116">◆ </a></span>vch</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">unsigned char CKey::vch[32]</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>The actual byte data. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="key_8h_source.html#l00046">46</a> of file <a class="el" href="key_8h_source.html">key.h</a>.</p>
|
|
|
|
<p class="reference">Referenced by <a class="el" href="key_8h_source.html#l00096">begin()</a>, <a class="el" href="key_8cpp_source.html#l00122">Check()</a>, <a class="el" href="key_8h_source.html#l00053">CKey()</a>, <a class="el" href="key_8h_source.html#l00097">end()</a>, <a class="el" href="key_8cpp_source.html#l00126">MakeNewKey()</a>, <a class="el" href="key_8h_source.html#l00079">Set()</a>, and <a class="el" href="key_8h_source.html#l00066">~CKey()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following files:<ul>
|
|
<li>src/<a class="el" href="key_8h_source.html">key.h</a></li>
|
|
<li>src/<a class="el" href="key_8cpp_source.html">key.cpp</a></li>
|
|
</ul>
|
|
</div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="classCKey.html">CKey</a></li>
|
|
<li class="footer">Generated on Thu Dec 14 2017 13:15:12 for Dash Core by
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|