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

    <tfoot id='Rt1Vi'></tfoot>

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

          <bdo id='Rt1Vi'></bdo><ul id='Rt1Vi'></ul>
      1. <legend id='Rt1Vi'><style id='Rt1Vi'><dir id='Rt1Vi'><q id='Rt1Vi'></q></dir></style></legend>

        如何将证书字符串转换为 X509 结构.?

        how to convert the Certificate String into X509 structure.?(如何将证书字符串转换为 X509 结构.?)
          <bdo id='XszsY'></bdo><ul id='XszsY'></ul>

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

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

              <tfoot id='XszsY'></tfoot>

                <tbody id='XszsY'></tbody>
                <legend id='XszsY'><style id='XszsY'><dir id='XszsY'><q id='XszsY'></q></dir></style></legend>

                  本文介绍了如何将证书字符串转换为 X509 结构.?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  谁能告诉我如何将字符串内容转换为X509结构.我正在使用 openssl 读取 X509 结构.

                  can any one tell me how to convert the string content into X509 structure . i am using openssl to read the X509 Structure.

                  示例:证书字符串

                  -----BEGIN CERTIFICATE-----
                  MIIExDCCA6ygAwIBAgIJAK0JmDc/YXWsMA0GCSqGSIb3DQEBBQUAMIGcMQswCQYD
                  VQQGEwJJTjELMAkGA1UECBMCQVAxDDAKBgNVBAcTA0hZRDEZMBcGA1UEChMQUm9j
                  a3dlbGwgY29sbGluczEcMBoGA1UECxMTSW5kaWEgRGVzaWduIENlbnRlcjEOMAwG
                  A1UEAxMFSU1BQ1MxKTAnBgkqhkiG9w0BCQEWGmJyYWphbkBSb2Nrd2VsbGNvbGxp
                  bnMuY29tMB4XDTExMDYxNjE0MTQyM1oXDTEyMDYxNTE0MTQyM1owgZwxCzAJBgNV
                  BAYTAklOMQswCQYDVQQIEwJBUDEMMAoGA1UEBxMDSFlEMRkwFwYDVQQKExBSb2Nr
                  d2VsbCBjb2xsaW5zMRwwGgYDVQQLExNJbmRpYSBEZXNpZ24gQ2VudGVyMQ4wDAYD
                  VQQDEwVJTUFDUzEpMCcGCSqGSIb3DQEJARYaYnJhamFuQFJvY2t3ZWxsY29sbGlu
                  cy5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDfjHgUAsbXQFkF
                  hqv8OTHSzuj+8SKGh49wth3UcH9Nk/YOug7ZvI+tnOcrCZdeG2Ot8Y19Wusf59Y7
                  q61jSbDWt+7u7P0ylWWcQfCE9IHSiJIaKAklMu2qGB8bFSPqDyVJuWSwcSXEb9C2
                  xJsabfgJr6mpfWjCOKd58wFprf0RF58pWHyBqBOiZ2U20PKhq8gPJo/pEpcnXTY0
                  x8bw8LZ3SrrIQZ5WntFKdB7McFKG9yFfEhUamTKOffQ2Y+SDEGVDj3eshF6+Fxgj
                  8plyg3tZPRLSHh5DR42HTc/35LA52BvjRMWYzrs4nf67gf652pgHh0tFMNMTMgZD
                  rpTkyts9AgMBAAGjggEFMIIBATAdBgNVHQ4EFgQUG0cLBjouoJPM8dQzKUQCZYNY
                  y8AwgdEGA1UdIwSByTCBxoAUG0cLBjouoJPM8dQzKUQCZYNYy8ChgaKkgZ8wgZwx
                  CzAJBgNVBAYTAklOMQswCQYDVQQIEwJBUDEMMAoGA1UEBxMDSFlEMRkwFwYDVQQK
                  ExBSb2Nrd2VsbCBjb2xsaW5zMRwwGgYDVQQLExNJbmRpYSBEZXNpZ24gQ2VudGVy
                  MQ4wDAYDVQQDEwVJTUFDUzEpMCcGCSqGSIb3DQEJARYaYnJhamFuQFJvY2t3ZWxs
                  Y29sbGlucy5jb22CCQCtCZg3P2F1rDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEB
                  BQUAA4IBAQCyYZxEzn7203no9TdhtKDWOFRwzYvY2kZppQ/EpzF+pzh8LdBOebr+
                  DLRXNh2NIFaEVV0brpQTI4eh6b5j7QyF2UmA6+44zmku9LzS9DQVKGLhIleB436K
                  ARoWRqxlEK7TF3TauQfaalGH88ZWoDjqqEP/5oWeQ6pr/RChkCHkBSgq6FfGGSLd
                  ktgFcF0S9U7Ybii/MD+tWMImK8EE3GGgs876yqX/DDhyfW8DfnNZyl35VF/80j/s
                  0Lj3F7Po1zsaRbQlhOK5rzRVQA2qnsa4IcQBuYqBWiB6XojPgu9PpRSL7ure7sj6
                  gRQT0OIU5vXzsmhjqKoZ+dBlh1FpSOX2
                  -----END CERTIFICATE-----
                  

                  这是我将作为字符串输入获得的证书.如何将其转换为 X509.

                  this the certificate i am going to get as string input.how to convert this into X509.

                  推荐答案

                  当作为字符串输入提供时,您可以使用此 OpenSSL 代码片段加载证书:

                  You can use this OpenSSL code snippet to load the certificate when provided as a string input:

                  #include <openssl/bio.h>
                  #include <openssl/x509.h>
                  #include <openssl/pem.h>
                  
                  const unsigned char *data = 
                      "-----BEGIN CERTIFICATE-----
                  "
                      "MIIExDCCA6ygAwIBAgIJAK0JmDc/YXWsMA0GCSqGSIb3DQEBBQUAMIGcMQswCQYD
                  "
                      /*...*/
                      "gRQT0OIU5vXzsmhjqKoZ+dBlh1FpSOX2
                  "
                      "-----END CERTIFICATE-----";
                  
                  BIO *bio;
                  X509 *certificate;
                  
                  bio = BIO_new(BIO_s_mem());
                  BIO_puts(bio, data);
                  certificate = PEM_read_bio_X509(bio, NULL, NULL, NULL);
                  

                  希望这会有所帮助.

                  这篇关于如何将证书字符串转换为 X509 结构.?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Unable to access non-const member functions of objects in C++ std::set(无法访问 C++ std::set 中对象的非常量成员函数)
                  How should a size-limited stl-like container be implemented?(应该如何实现大小受限的 stl 类容器?)
                  Constructing std::function argument from lambda(从 lambda 构造 std::function 参数)
                  STL BigInt class implementation(STL BigInt 类实现)
                  Sync is unreliable using std::atomic and std::condition_variable(使用 std::atomic 和 std::condition_variable 同步不可靠)
                  Move list element to the end in STL(在 STL 中将列表元素移动到末尾)
                  <legend id='3w8ae'><style id='3w8ae'><dir id='3w8ae'><q id='3w8ae'></q></dir></style></legend>

                  <small id='3w8ae'></small><noframes id='3w8ae'>

                      • <bdo id='3w8ae'></bdo><ul id='3w8ae'></ul>
                      • <tfoot id='3w8ae'></tfoot>

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

                              <tbody id='3w8ae'></tbody>