久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<i id='2HeiY'><tr id='2HeiY'><dt id='2HeiY'><q id='2HeiY'><span id='2HeiY'><b id='2HeiY'><form id='2HeiY'><ins id='2HeiY'></ins><ul id='2HeiY'></ul><sub id='2HeiY'></sub></form><legend id='2HeiY'></legend><bdo id='2HeiY'><pre id='2HeiY'><center id='2HeiY'></center></pre></bdo></b><th id='2HeiY'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='2HeiY'><tfoot id='2HeiY'></tfoot><dl id='2HeiY'><fieldset id='2HeiY'></fieldset></dl></div>
<legend id='2HeiY'><style id='2HeiY'><dir id='2HeiY'><q id='2HeiY'></q></dir></style></legend>
      <bdo id='2HeiY'></bdo><ul id='2HeiY'></ul>

    1. <small id='2HeiY'></small><noframes id='2HeiY'>

    2. <tfoot id='2HeiY'></tfoot>
    3. 在 C# 中加載 ASN.1/DER 編碼的 RSA 密鑰對(duì)

      Load ASN.1/DER encoded RSA keypair in C#(在 C# 中加載 ASN.1/DER 編碼的 RSA 密鑰對(duì))
    4. <small id='Sdews'></small><noframes id='Sdews'>

      <tfoot id='Sdews'></tfoot>
      <legend id='Sdews'><style id='Sdews'><dir id='Sdews'><q id='Sdews'></q></dir></style></legend>

        <tbody id='Sdews'></tbody>

        • <i id='Sdews'><tr id='Sdews'><dt id='Sdews'><q id='Sdews'><span id='Sdews'><b id='Sdews'><form id='Sdews'><ins id='Sdews'></ins><ul id='Sdews'></ul><sub id='Sdews'></sub></form><legend id='Sdews'></legend><bdo id='Sdews'><pre id='Sdews'><center id='Sdews'></center></pre></bdo></b><th id='Sdews'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Sdews'><tfoot id='Sdews'></tfoot><dl id='Sdews'><fieldset id='Sdews'></fieldset></dl></div>
              <bdo id='Sdews'></bdo><ul id='Sdews'></ul>
              • 本文介紹了在 C# 中加載 ASN.1/DER 編碼的 RSA 密鑰對(duì)的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                限時(shí)送ChatGPT賬號(hào)..

                我在 Crypto++ 中創(chuàng)建了 DER 編碼的 RSA 密鑰對(duì)以及密碼.它們是 Base64Encoded 字符串.我首先將數(shù)據(jù)從 Base64 解碼為字節(jié)數(shù)組,但我不確定如何將它們加載到 RSACryptoServiceProvider.

                I have DER encoded RSA keypair created in Crypto++, as well as cipher. They are Base64Encoded string. I first decode the data from Base64 to byte array, but I am not sure how to load them into RSACryptoServiceProvider.

                static void Main()
                {
                    string pbkeystr = "mypublickey";
                    string pvkeystr = "myprivatekey";
                    string cipherstr = "mycipher";
                
                    byte[] pbkey = Convert.FromBase64String(pbkeystr);
                    byte[] pvkey = Convert.FromBase64String(pvkeystr);
                    byte[] cipher = Convert.FromBase64String(cipherstr);
                
                    RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
                
                    //Set keys here..
                
                    //Decrypt the cipher using private key
                    rsa.Decrypt(pvkey, false);
                }
                

                沒有設(shè)置鍵的功能.我唯一找到的是 ImportParameters 方法,它采用 RSAParameters 類,該類由 pqn、模數(shù)、指數(shù)等.我無權(quán)訪問這些.

                There are no functions to set keys. The only thing I found was ImportParameters method, which takes RSAParameters class which consists of p, q, n, modulus, exponent etc. I don't have access to these.

                有什么方法可以將鍵加載為字符串?如何將密鑰加載到 RSACryptoServiceProvider?

                Is there any way I can load the keys as string? How can I load the key into RSACryptoServiceProvider?

                推薦答案

                有什么方法可以將鍵加載為字符串?如何將密鑰加載到 RSACryptoServiceProvider 中?

                Is there any way I can load the keys as string? How can I load the key into RSACryptoServiceProvider?

                從您的其他 Crypto++ 問題,如何在 Crypto++ 中加載 Base64 RSA 密鑰,您似乎有 公鑰和私鑰,因?yàn)槟褂昧?DEREncodeBERDecode.也就是說,您有 RSA 參數(shù),而不是主題公鑰信息和私鑰信息.您的密鑰缺少 OID 標(biāo)識(shí)符和版本號(hào).那樣就好了.

                From your other Crypto++ question, How to load Base64 RSA keys in Crypto++, it looks like you have only the public and private keys because you used DEREncode and BERDecode. That is, you have the RSA parameters, and not the subject public key info and the private key info. Your keys lack the OID identifiers and version numbers. Things are fine that way.

                從代碼項(xiàng)目上的 加密互操作性:密鑰,您在 Base64 解碼后將需要一個(gè)解析 ASN.1/DER 的 C# 類.CodeProject 文章提供了一個(gè)名為 AsnKeyParser 的 C# 類來讀取 ASN.1/DER 并返回一個(gè) RSAParameters 以加載到 CSP 中.

                From Cryptographic Interoperability: Keys on the Code Project, you will need a C# class that parses the ASN.1/DER after you Base64 decode it. The CodeProject article provides a C# class called AsnKeyParser to read the ASN.1/DER and returns a RSAParameters to load into a CSP.

                AsnKeyParser 類的代碼大約有 800 行,另外還有 5 個(gè)支持文件來完成這一切,所以放在這里不太合適.你應(yīng)該自己下載.感興趣的文件稱為 CSInteropKeys.zip.

                The code for the AsnKeyParser class is about 800 lines, and there are five other supporting files to make it all happen, so its not really appropriate to place it here. You should download it yourself. The file of interest is called CSInteropKeys.zip.

                一旦您連接到 AsnKeyParser 類,就如同下面的 RSA 公鑰一樣簡(jiǎn)單.私鑰類似,代碼在 CodeProject 網(wǎng)站上給出.

                Once you wire-in the AsnKeyParser class, it will be as simple as the following for a RSA Public key. The private key will be similar, and the code is given on the CodeProject site.

                // Your ASN.1/DER parser class
                AsnKeyParser keyParser = new AsnKeyParser("rsa-public.der");
                RSAParameters publicKey = keyParser.ParseRSAPublicKey();
                
                // .Net class
                CspParameters csp = new CspParameters;
                csp.KeyContainerName = "RSA Test (OK to Delete)";    
                csp.ProviderType = PROV_RSA_FULL;    // 1
                csp.KeyNumber = AT_KEYEXCHANGE;      // 1
                
                // .Net class
                RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(csp);
                rsa.PersistKeyInCsp = false;
                rsa.ImportParameters(publicKey);
                

                不贊成鏈接到另一個(gè)站點(diǎn)上的文件,但我不知道如何提供其他信息.答案中涉及的源代碼太多.

                Linking to files on another site is frowned upon, but I don't know how to provide the information otherwise. There's too much source code involved to place in an answer.

                為了完整性,.Net 使互操作變得容易.他們不接受 ASN.1/DER 或 PEM.相反,.Net 接受一些 XML 表示的鍵.我相信您可以在 RFC 3275, XML-Signature Syntax and Processing 中找到它.Microsoft 沒有為您聲明.我在寫代碼項(xiàng)目文章時(shí)將其拼湊起來.

                For completeness, .Net does not make interop easy. They do not accept ASN.1/DER or PEM. Rather, .Net accepts some XML representation of the keys. I believe you can find it in RFC 3275, XML-Signature Syntax and Processing. Microsoft does not state that for you. I kind of pieced it together when I wrote the Code Project article.

                除了 ASN.1/DER 和 PEM 之外,也許我們應(yīng)該在 Crypto++ 中添加一個(gè)類來反芻 XML.

                Maybe we should add a class to Crypto++ to regurgitate XML in addition to ASN.1/DER and PEM.

                這篇關(guān)于在 C# 中加載 ASN.1/DER 編碼的 RSA 密鑰對(duì)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                What are good algorithms for vehicle license plate detection?(車牌檢測(cè)有哪些好的算法?)
                onClick event for Image in Unity(Unity中圖像的onClick事件)
                Running Total C#(運(yùn)行總 C#)
                Deleting a directory when clicked on a hyperlink with JAvascript.ASP.NET C#(單擊帶有 JAvascript.ASP.NET C# 的超鏈接時(shí)刪除目錄)
                asp.net listview highlight row on click(asp.net listview 在單擊時(shí)突出顯示行)
                Calling A Button OnClick from a function(從函數(shù)調(diào)用按鈕 OnClick)

                    <bdo id='qT9Hw'></bdo><ul id='qT9Hw'></ul>
                    <i id='qT9Hw'><tr id='qT9Hw'><dt id='qT9Hw'><q id='qT9Hw'><span id='qT9Hw'><b id='qT9Hw'><form id='qT9Hw'><ins id='qT9Hw'></ins><ul id='qT9Hw'></ul><sub id='qT9Hw'></sub></form><legend id='qT9Hw'></legend><bdo id='qT9Hw'><pre id='qT9Hw'><center id='qT9Hw'></center></pre></bdo></b><th id='qT9Hw'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='qT9Hw'><tfoot id='qT9Hw'></tfoot><dl id='qT9Hw'><fieldset id='qT9Hw'></fieldset></dl></div>
                    <legend id='qT9Hw'><style id='qT9Hw'><dir id='qT9Hw'><q id='qT9Hw'></q></dir></style></legend>

                        <tbody id='qT9Hw'></tbody>

                      1. <tfoot id='qT9Hw'></tfoot>

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

                          主站蜘蛛池模板: 日韩精品一区二区视频 | 日本人做爰全过程 | 欧美精品www | 看片地址 | 亚洲综合久久久 | 日韩在线中文字幕 | 日韩精品网 | 一区二区三区视频在线播放 | 色人人| 久久久久免费 | 亚洲一区在线看 | 99av| 久热精品在线 | 欧美性生交xxxxx久久久 | 黄在线免费观看 | 久青草影院 | 在线观看视频一区 | 亚洲精品久久久久 | 亚洲欧美另类在线观看 | 国产又色又爽又黄又免费 | 五月播播| 永久黄网站色视频免费观看w | 国产一区二区在线播放 | 成人看片免费 | 久草香蕉视频 | 日韩精品片 | 国产精品99久久久久久久久久久久 | 天天摸夜夜操 | 毛片在线免费 | 少妇一级淫片免费看 | 精品欧美一区二区三区久久久 | 黄色大片免费观看 | 视频一区在线播放 | a级黄色片 | 在线少妇 | 精品热久久 | 日韩一区二区三区免费 | 国产精品一区二区三区不卡 | 日本黄色录像 | 又色又爽又黄gif动态图 | 4438成人网 |