• <small id='UrMGp'></small><noframes id='UrMGp'>

    1. <tfoot id='UrMGp'></tfoot>
      <i id='UrMGp'><tr id='UrMGp'><dt id='UrMGp'><q id='UrMGp'><span id='UrMGp'><b id='UrMGp'><form id='UrMGp'><ins id='UrMGp'></ins><ul id='UrMGp'></ul><sub id='UrMGp'></sub></form><legend id='UrMGp'></legend><bdo id='UrMGp'><pre id='UrMGp'><center id='UrMGp'></center></pre></bdo></b><th id='UrMGp'></th></span></q></dt></tr></i><div id='UrMGp'><tfoot id='UrMGp'></tfoot><dl id='UrMGp'><fieldset id='UrMGp'></fieldset></dl></div>

      • <bdo id='UrMGp'></bdo><ul id='UrMGp'></ul>
      <legend id='UrMGp'><style id='UrMGp'><dir id='UrMGp'><q id='UrMGp'></q></dir></style></legend>

        如何存储/检索 RSA 公钥/私钥

        时间:2023-06-01
              <tbody id='KJL6K'></tbody>

                <legend id='KJL6K'><style id='KJL6K'><dir id='KJL6K'><q id='KJL6K'></q></dir></style></legend>

                <small id='KJL6K'></small><noframes id='KJL6K'>

                  <bdo id='KJL6K'></bdo><ul id='KJL6K'></ul>
                  <i id='KJL6K'><tr id='KJL6K'><dt id='KJL6K'><q id='KJL6K'><span id='KJL6K'><b id='KJL6K'><form id='KJL6K'><ins id='KJL6K'></ins><ul id='KJL6K'></ul><sub id='KJL6K'></sub></form><legend id='KJL6K'></legend><bdo id='KJL6K'><pre id='KJL6K'><center id='KJL6K'></center></pre></bdo></b><th id='KJL6K'></th></span></q></dt></tr></i><div id='KJL6K'><tfoot id='KJL6K'></tfoot><dl id='KJL6K'><fieldset id='KJL6K'></fieldset></dl></div>

                • <tfoot id='KJL6K'></tfoot>
                  本文介绍了如何存储/检索 RSA 公钥/私钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我想使用 RSA 公钥加密.存储或检索私钥和公钥的最佳方式是什么?XML 在这里是个好主意吗?

                  I want to use RSA public key encryption. What is the best way to store or retrieve private and public keys? Is XML a good idea here?

                  如何获得钥匙?

                  RSAParameters privateKey = RSA.ExportParameters(true);
                  RSAParameters publicKey = RSA.ExportParameters(false);
                  

                  因为 RSAParameters 有以下成员:D, DP, DQ, Exponent, InverseQ, Modulus, P, Q

                  Because RSAParameters have the following members: D, DP, DQ, Exponent, InverseQ, Modulus, P, Q

                  哪一个是关键?

                  推荐答案

                  我成功的是将密钥存储为 XML.RSACryptoServiceProvider 中有两种方法:ToXmlString 和 FromXmlString.ToXmlString 将返回一个 XML 字符串,该字符串要么仅包含公钥数据,要么包含公钥和私钥数据,具体取决于您设置其参数的方式.当提供仅包含公钥数据或同时包含公钥和私钥数据的 XML 字符串时,FromXmlString 方法将使用适当的密钥数据填充 RSACryptoServiceProvider.

                  What I have done successfully is to store the keys as XML. There are two methods in RSACryptoServiceProvider: ToXmlString and FromXmlString. The ToXmlString will return an XML string containing either just the public key data or both the public and private key data depending on how you set its parameter. The FromXmlString method will populate the RSACryptoServiceProvider with the appropriate key data when provided an XML string containing either just the public key data or both the public and private key data.

                  这篇关于如何存储/检索 RSA 公钥/私钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何在 C# 中生成加密安全的伪随机数? 下一篇:如何在 C# 中使用 RSA 加密文件(大数据)

                  相关文章

                  最新文章

                    <bdo id='pxQHV'></bdo><ul id='pxQHV'></ul>

                    1. <tfoot id='pxQHV'></tfoot>
                      <i id='pxQHV'><tr id='pxQHV'><dt id='pxQHV'><q id='pxQHV'><span id='pxQHV'><b id='pxQHV'><form id='pxQHV'><ins id='pxQHV'></ins><ul id='pxQHV'></ul><sub id='pxQHV'></sub></form><legend id='pxQHV'></legend><bdo id='pxQHV'><pre id='pxQHV'><center id='pxQHV'></center></pre></bdo></b><th id='pxQHV'></th></span></q></dt></tr></i><div id='pxQHV'><tfoot id='pxQHV'></tfoot><dl id='pxQHV'><fieldset id='pxQHV'></fieldset></dl></div>

                      <small id='pxQHV'></small><noframes id='pxQHV'>

                    2. <legend id='pxQHV'><style id='pxQHV'><dir id='pxQHV'><q id='pxQHV'></q></dir></style></legend>