<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">2016-12-13 22:54 GMT-03:00 Salz, Rich <span dir="ltr"><<a href="mailto:rsalz@akamai.com" target="_blank">rsalz@akamai.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">> Is there some equivalent to PHP's openssl_sign_pkcs7 function for C/C++ users?<br>
<br>
</span>Look at the apps/pkcs7.c file as a starting point.  Get the command line doing what you want, and then work through the code to pull out only the bits you need.<br>
<span class="gmail-HOEnZb"><font color="#888888"><br>
--<br>
openssl-users mailing list<br>
To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" rel="noreferrer" target="_blank">https://mta.openssl.org/<wbr>mailman/listinfo/openssl-users</a><br>
</font></span></blockquote></div><div class="gmail_extra"><br></div>Got it, after some more reading, I've managed to pull:<div>A Valid X509 structure with the PEM file.</div><div>A Valid EVP_PKEY structure with the KEY file.</div><div>Created a BIO with BIO_new(BIO_s_mem()) and used BIO_read_filename with it.</div><div><br></div><div>Now I get to the part where I need to call PKCS7_sign() right?</div><div>If so, I'm missing something, because:</div><div>PKCS7_sign(cert,key,NULL,fileBIO,NULL) produces NULL as a result.</div><div><br></div><div>Any hints?</div></div></div>