⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cypher_8h-source.html

📁 pwlib开发文档
💻 HTML
📖 第 1 页 / 共 4 页
字号:
00705     <a class="code" href="classPTEACypher.html#a0">PTEACypher</a>(00706       <span class="keyword">const</span> Key &amp; keyData,     00707       <a class="code" href="classPCypher.html#s9">BlockChainMode</a> <a class="code" href="classPCypher.html#n2">chainMode</a> = <a class="code" href="classPCypher.html#s9s0">ElectronicCodebook</a>   00708     );00709 00710 00712     <span class="keywordtype">void</span> <a class="code" href="classPTEACypher.html#a2">SetKey</a>(00713       <span class="keyword">const</span> Key &amp; newKey    00714     );00715 00717     <span class="keywordtype">void</span> <a class="code" href="classPTEACypher.html#a3">GetKey</a>(00718       Key &amp; newKey    00719     ) <span class="keyword">const</span>;00720 00721 00723     <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classPTEACypher.html#d0">GenerateKey</a>(00724       Key &amp; newKey    00725     );00726 00727 00728   <span class="keyword">protected</span>:00730     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPTEACypher.html#b0">Initialise</a>(00731       BOOL encoding   00732     );00733 00735     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPTEACypher.html#b1">EncodeBlock</a>(00736       <span class="keyword">const</span> <span class="keywordtype">void</span> * in,  00737       <span class="keywordtype">void</span> * out        00738     );00739 00741     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPTEACypher.html#b2">DecodeBlock</a>(00742       <span class="keyword">const</span> <span class="keywordtype">void</span> * in,  00743       <span class="keywordtype">void</span> * out        00744     );00745 00746   <span class="keyword">private</span>:00747     DWORD k0, k1, k2, k3;00748 };00749 00750 00751 <a name="l00752"></a><a class="code" href="classPSecureConfig.html">00752</a> <span class="keyword">class </span><a class="code" href="classPSecureConfig.html">PSecureConfig</a> : <span class="keyword">public</span> <a class="code" href="classPConfig.html">PConfig</a>00753 {00754   <a class="code" href="object_8h.html#a27">PCLASSINFO</a>(<a class="code" href="classPSecureConfig.html">PSecureConfig</a>, <a class="code" href="classPConfig.html">PConfig</a>)00755 <span class="comment">/* This class defines a set of configuration keys which may be secured by an</span>00756 <span class="comment">   encrypted hash function. Thus values contained in keys specified by this</span>00757 <span class="comment">   class cannot be changed without invalidating the hash function.</span>00758 <span class="comment"> */</span>00759 00760   <span class="keyword">public</span>:00761     <a class="code" href="classPSecureConfig.html#a0">PSecureConfig</a>(00762       <span class="keyword">const</span> <a class="code" href="structPTEACypher_1_1Key.html">PTEACypher::Key</a> &amp; <a class="code" href="classPSecureConfig.html#n0">productKey</a>,    <span class="comment">// Key to decrypt validation code.</span>00763       <span class="keyword">const</span> <a class="code" href="classPStringArray.html">PStringArray</a>    &amp; <a class="code" href="classPSecureConfig.html#n1">securedKeys</a>,   <span class="comment">// List of secured keys.</span>00764       <a class="code" href="classPConfig.html#z61_0">Source</a> src = <a class="code" href="classPConfig.html#z61_0s2">Application</a>        <span class="comment">// Standard source for the configuration.</span>00765     );00766     <a class="code" href="classPSecureConfig.html#a0">PSecureConfig</a>(00767       <span class="keyword">const</span> <a class="code" href="structPTEACypher_1_1Key.html">PTEACypher::Key</a> &amp; productKey,   <span class="comment">// Key to decrypt validation code.</span>00768       <span class="keyword">const</span> <span class="keywordtype">char</span> * <span class="keyword">const</span> * securedKeyArray, <span class="comment">// List of secured keys.</span>00769       PINDEX count,                         <span class="comment">// Number of secured keys in list.</span>00770       <a class="code" href="classPConfig.html#z61_0">Source</a> src = <a class="code" href="classPConfig.html#z61_0s2">Application</a>        <span class="comment">// Standard source for the configuration.</span>00771     );00772     <span class="comment">/* Create a secured configuration. The default section for the</span>00773 <span class="comment">       configuration keys is "Secured Options", the default security key is</span>00774 <span class="comment">       "Validation" and the defualt prefix string is "Pending:".</span>00775 <span class="comment"></span>00776 <span class="comment">       The user can descend from this class and change any of the member</span>00777 <span class="comment">       variable for the names of keys or the configuration file section.</span>00778 <span class="comment">     */</span>00779 00780 00781   <span class="comment">// New functions for class</span><a name="l00782"></a><a class="code" href="classPSecureConfig.html#a2">00782</a>     <span class="keyword">const</span> <a class="code" href="classPStringArray.html">PStringArray</a> &amp; <a class="code" href="classPSecureConfig.html#a2">GetSecuredKeys</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> securedKeys; }00783     <span class="comment">/* Get the list of secured keys in the configuration file section.</span>00784 <span class="comment"></span>00785 <span class="comment">       @return</span>00786 <span class="comment">       Array of  strings for the secured keys.</span>00787 <span class="comment">     */</span>00788 <a name="l00789"></a><a class="code" href="classPSecureConfig.html#a3">00789</a>     <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> &amp; <a class="code" href="classPSecureConfig.html#a3">GetSecurityKey</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classPSecureConfig.html#n2">securityKey</a>; }00790     <span class="comment">/* Get the security keys name in the configuration file section.</span>00791 <span class="comment"></span>00792 <span class="comment">       @return</span>00793 <span class="comment">       String for the security values key.</span>00794 <span class="comment">     */</span>00795 <a name="l00796"></a><a class="code" href="classPSecureConfig.html#a4">00796</a>     <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> &amp; <a class="code" href="classPSecureConfig.html#a4">GetExpiryDateKey</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classPSecureConfig.html#n3">expiryDateKey</a>; }00797     <span class="comment">/* Get the expiry date keys name in the configuration file section.</span>00798 <span class="comment"></span>00799 <span class="comment">       @return</span>00800 <span class="comment">       String for the expiry date values key.</span>00801 <span class="comment">     */</span>00802 <a name="l00803"></a><a class="code" href="classPSecureConfig.html#a5">00803</a>     <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> &amp; <a class="code" href="classPSecureConfig.html#a5">GetOptionBitsKey</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classPSecureConfig.html#n4">optionBitsKey</a>; }00804     <span class="comment">/* Get the Option Bits keys name in the configuration file section.</span>00805 <span class="comment"></span>00806 <span class="comment">       @return</span>00807 <span class="comment">       String for the Option Bits values key.</span>00808 <span class="comment">     */</span>00809 <a name="l00810"></a><a class="code" href="classPSecureConfig.html#a6">00810</a>     <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> &amp; <a class="code" href="classPSecureConfig.html#a6">GetPendingPrefix</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classPSecureConfig.html#n5">pendingPrefix</a>; }00811     <span class="comment">/* Get the pending prefix name in the configuration file section.</span>00812 <span class="comment"></span>00813 <span class="comment">       @return</span>00814 <span class="comment">       String for the pending prefix.</span>00815 <span class="comment">     */</span>00816 00817     <span class="keywordtype">void</span> <a class="code" href="classPSecureConfig.html#a7">GetProductKey</a>(00818       <a class="code" href="structPTEACypher_1_1Key.html">PTEACypher::Key</a> &amp; productKey  <span class="comment">// Variable to receive the product key.</span>00819     ) <span class="keyword">const</span>;00820     <span class="comment">/* Get the pending prefix name in the configuration file section.</span>00821 <span class="comment"></span>00822 <span class="comment">       @return</span>00823 <span class="comment">       String for the pending prefix.</span>00824 <span class="comment">     */</span>00825 00826 <a name="l00827"></a><a class="code" href="classPSecureConfig.html#s5">00827</a>     <span class="keyword">enum</span> <a class="code" href="classPSecureConfig.html#s5">ValidationState</a> {00828       <a class="code" href="classPSecureConfig.html#s5s0">Defaults</a>,00829       <a class="code" href="classPSecureConfig.html#s5s1">Pending</a>,00830       <a class="code" href="classPSecureConfig.html#s5s2">IsValid</a>,00831       <a class="code" href="classPSecureConfig.html#s5s3">Expired</a>,00832       <a class="code" href="classPSecureConfig.html#s5s4">Invalid</a>00833     };00834     <a class="code" href="classPSecureConfig.html#s5">ValidationState</a> <a class="code" href="classPSecureConfig.html#a8">GetValidation</a>() <span class="keyword">const</span>;00835     <span class="comment">/* Check the current values attached to the keys specified in the</span>00836 <span class="comment">       constructor against an encoded validation key.</span>00837 <span class="comment"></span>00838 <span class="comment">       @return</span>00839 <span class="comment">       State of the validation keys.</span>00840 <span class="comment">     */</span>00841 00842     BOOL <a class="code" href="classPSecureConfig.html#a9">ValidatePending</a>();00843     <span class="comment">/* Validate a pending secured option list for the product. All secured</span>00844 <span class="comment">       keys with the &lt;CODE&gt;pendingPrefix&lt;/CODE&gt; name will be checked against</span>00845 <span class="comment">       the value of the field &lt;CODE&gt;securityKey&lt;/CODE&gt;. If they match then</span>00846 <span class="comment">       they are copied to the secured variables.</span>00847 <span class="comment"></span>00848 <span class="comment">       @return</span>00849 <span class="comment">       TRUE if secure key values are valid.</span>00850 <span class="comment">     */</span>00851 00852     <span class="keywordtype">void</span> <a class="code" href="classPSecureConfig.html#a10">ResetPending</a>();00853     <span class="comment">/* "Unvalidate" a security configuration going back to a pending state,</span>00854 <span class="comment">       usually used after an &lt;CODE&gt;Invalid&lt;/CODE&gt; response was recieved from</span>00855 <span class="comment">       the &lt;A&gt;GetValidation()&lt;/A&gt; function.</span>00856 <span class="comment">     */</span>00857 00858 00859   <span class="keyword">protected</span>:<a name="l00860"></a><a class="code" href="classPSecureConfig.html#n0">00860</a>     <a class="code" href="structPTEACypher_1_1Key.html">PTEACypher::Key</a> productKey;<a name="l00861"></a><a class="code" href="classPSecureConfig.html#n1">00861</a>     <a class="code" href="classPStringArray.html">PStringArray</a>    securedKeys;<a name="l00862"></a><a class="code" href="classPSecureConfig.html#n2">00862</a>     <a class="code" href="classPString.html">PString</a>         <a class="code" href="classPSecureConfig.html#n2">securityKey</a>;<a name="l00863"></a><a class="code" href="classPSecureConfig.html#n3">00863</a>     <a class="code" href="classPString.html">PString</a>         <a class="code" href="classPSecureConfig.html#n3">expiryDateKey</a>;<a name="l00864"></a><a class="code" href="classPSecureConfig.html#n4">00864</a>     <a class="code" href="classPString.html">PString</a>         <a class="code" href="classPSecureConfig.html#n4">optionBitsKey</a>;<a name="l00865"></a><a class="code" href="classPSecureConfig.html#n5">00865</a>     <a class="code" href="classPString.html">PString</a>         <a class="code" href="classPSecureConfig.html#n5">pendingPrefix</a>;00866 };00867 00868 00869 <span class="preprocessor">#endif // _PCYPHER</span>00870 <span class="preprocessor"></span>00871 00872 <span class="comment">// End Of File ///////////////////////////////////////////////////////////////</span></pre></div><hr><address style="align: right;"><small>Generated on Wed Sep 29 22:44:10 2004 for PWLib by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -