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

📄 rsa_8h-source.html

📁 著名的密码库Crypto++的文档 C++语言的杰作。程序员必备。
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><title>Crypto++: rsa.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"><link href="tabs.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.5.2 --><div class="tabs">  <ul>    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>    <li><a href="namespaces.html"><span>Namespaces</span></a></li>    <li><a href="classes.html"><span>Classes</span></a></li>    <li class="current"><a href="files.html"><span>Files</span></a></li>  </ul></div><div class="tabs">  <ul>    <li><a href="files.html"><span>File&nbsp;List</span></a></li>    <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>  </ul></div><h1>rsa.h</h1><a href="rsa_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef CRYPTOPP_RSA_H</span><a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_RSA_H</span><a name="l00003"></a>00003 <span class="preprocessor"></span><span class="comment"></span><a name="l00004"></a>00004 <span class="comment">/** \file</span><a name="l00005"></a>00005 <span class="comment">        This file contains classes that implement the RSA</span><a name="l00006"></a>00006 <span class="comment">        ciphers and signature schemes as defined in PKCS #1 v2.0.</span><a name="l00007"></a>00007 <span class="comment">*/</span><a name="l00008"></a>00008 <a name="l00009"></a>00009 <span class="preprocessor">#include "<a class="code" href="pubkey_8h.html" title="This file contains helper classes/functions for implementing public key algorithms...">pubkey.h</a>"</span><a name="l00010"></a>00010 <span class="preprocessor">#include "asn.h"</span><a name="l00011"></a>00011 <span class="preprocessor">#include "pkcspad.h"</span><a name="l00012"></a>00012 <span class="preprocessor">#include "oaep.h"</span><a name="l00013"></a>00013 <span class="preprocessor">#include "<a class="code" href="emsa2_8h.html" title="This file contains various padding schemes for public key algorithms.">emsa2.h</a>"</span><a name="l00014"></a>00014 <a name="l00015"></a>00015 NAMESPACE_BEGIN(CryptoPP)<a name="l00016"></a>00016 <a name="l00017"></a>00017 <span class="comment">//! _</span><a name="l00018"></a><a class="code" href="class_r_s_a_function.html">00018</a> <span class="comment"></span>class CRYPTOPP_DLL <a class="code" href="class_r_s_a_function.html" title="_">RSAFunction</a> : public <a class="code" href="class_trapdoor_function.html" title="_">TrapdoorFunction</a>, public <a class="code" href="class_x509_public_key.html" title="encodes/decodes subjectPublicKeyInfo">X509PublicKey</a><a name="l00019"></a>00019 {<a name="l00020"></a>00020         <span class="keyword">typedef</span> <a class="code" href="class_r_s_a_function.html" title="_">RSAFunction</a> <a class="code" href="class_r_s_a_function.html" title="_">ThisClass</a>;<a name="l00021"></a>00021 <a name="l00022"></a>00022 <span class="keyword">public</span>:<a name="l00023"></a><a class="code" href="class_r_s_a_function.html#8f1a1bd46126545fe9e43cd1e259cba2">00023</a>         <span class="keywordtype">void</span> Initialize(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;n, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;e)<a name="l00024"></a>00024                 {m_n = n; m_e = e;}<a name="l00025"></a>00025 <a name="l00026"></a>00026         <span class="comment">// X509PublicKey</span><a name="l00027"></a>00027         <a class="code" href="class_o_i_d.html" title="Object Identifier.">OID</a> GetAlgorithmID() <span class="keyword">const</span>;<a name="l00028"></a>00028         <span class="keywordtype">void</span> BERDecodePublicKey(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;bt, <span class="keywordtype">bool</span> parametersPresent, <span class="keywordtype">size_t</span> size);<a name="l00029"></a>00029         <span class="keywordtype">void</span> DEREncodePublicKey(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;bt) <span class="keyword">const</span>;<a name="l00030"></a>00030 <a name="l00031"></a>00031         <span class="comment">// CryptoMaterial</span><a name="l00032"></a>00032         <span class="keywordtype">bool</span> Validate(<a class="code" href="class_random_number_generator.html" title="interface for random number generators">RandomNumberGenerator</a> &amp;rng, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> level) <span class="keyword">const</span>;<a name="l00033"></a>00033         <span class="keywordtype">bool</span> GetVoidValue(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> std::type_info &amp;valueType, <span class="keywordtype">void</span> *pValue) <span class="keyword">const</span>;<a name="l00034"></a>00034         <span class="keywordtype">void</span> AssignFrom(<span class="keyword">const</span> <a class="code" href="class_name_value_pairs.html" title="interface for retrieving values given their names">NameValuePairs</a> &amp;source);<a name="l00035"></a>00035 <a name="l00036"></a>00036         <span class="comment">// TrapdoorFunction</span><a name="l00037"></a>00037         <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> ApplyFunction(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;x) <span class="keyword">const</span>;<a name="l00038"></a><a class="code" href="class_r_s_a_function.html#5eb6f0be67906fe2659e7d62fe54b317">00038</a>         <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> PreimageBound()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_n;}<a name="l00039"></a><a class="code" href="class_r_s_a_function.html#1f5226f0dfa30c01a1aedd4f21d26335">00039</a>         <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> ImageBound()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_n;}<a name="l00040"></a>00040 <a name="l00041"></a>00041         <span class="comment">// non-derived</span><a name="l00042"></a><a class="code" href="class_r_s_a_function.html#99c0e01177c39ebe388f3c180557eb66">00042</a>         <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp; GetModulus()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_n;}<a name="l00043"></a><a class="code" href="class_r_s_a_function.html#81f7cd9401637d24f69f63fffeca89a5">00043</a>         <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp; GetPublicExponent()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_e;}<a name="l00044"></a>00044 <a name="l00045"></a><a class="code" href="class_r_s_a_function.html#6704ae9b7607ea8cac82c27303c8ff32">00045</a>         <span class="keywordtype">void</span> SetModulus(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;n) {m_n = n;}<a name="l00046"></a><a class="code" href="class_r_s_a_function.html#1d6ff0264475bad18692ac81ba0c1b9e">00046</a>         <span class="keywordtype">void</span> SetPublicExponent(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;e) {m_e = e;}

⌨️ 快捷键说明

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