<div dir="ltr"><div>Hello all,</div><div><br></div><div>    I am developing a library 
that uses an HSM, and I need to create a CSR to send to the CA. I have 
some examples using the X509_REQ to set the public key and attributes. I
 've also seen examples of signing the CSR, which finds the req_info 
that is needed to sign the CSR: </div><div><br></div><div><pre><code>  <span>EVP_PKEY_assign_RSA</span>( pkey , rsa );
  <span>X509_REQ_set_pubkey</span>(req, pkey);

  subj=<span>X509_REQ_get_subject_name</span>(req);
  <span>X509_NAME_add_entry_by_txt</span>(subj,<span>"C"</span>,
                          MBSTRING_ASC, (<span>unsigned</span> <span>char</span> *)<span>"SK"</span>, <span>-1</span>, <span>-1</span>, <span>0</span>);
  <span>X509_NAME_add_entry_by_txt</span>(subj,<span>"CN"</span>,
                          MBSTRING_ASC, (<span>unsigned</span> <span>char</span> *)<span>"Test"</span>, <span>-1</span>, <span>-1</span>, <span>0</span>);

  <span>int</span> datasig_len;
  <span>unsigned</span> <span>char</span> *tobesigned;
 <font size="4"><b> datasig_len = <span>i2d_X509_REQ_INFO</span>( req->req_info, <span>NULL</span> );<br></b></font></code></pre><pre><code></code></pre><pre><code></code></pre><pre><code><br></code></pre></div><div><br></div><div>When I compile the last line, I get the error: error: 'invalid use of incomplete type ‘X509_REQ {aka struct X509_req_st}'</div><div><br></div><div>I
 have discovered that the header x509.h obfuscates the type 'req_info', 
and upon further research, I also found that this type was eliminated 
since v1.1.0 of OpenSSL.<br></div><div><br></div><div>Does anyone know of an alternative to accessing the 'req_info' element, or another way I can access the info I need to sign?</div><div><br></div><div>Thanks for your help. </div></div>