Add optional OID in CMS/PKCS 7 signature in C# and Compact Framework 3.5 <p>By using CAPI functions (in C# and Compact Framework 3.5), I try to sign a XML and create an CMS/PKCS envelop like the following OpenSSL command do:</p> <pre><code>openssl smime -sign -in file.xml -out file.b64 -passin pass:test -binary -nodetach -inkey cert.priv.pem -signer cert.pub.pem </code></pre> <p>By calling the functions "CryptMsgOpenToEncode" and "CryptMsgUpdate", I obtain a first signed file. Now I would add optional OID and others datas (more precisely the "SMIMECapabilities", and signing time).</p> <p>How to do this?</p>