title: Extract signing certs from a PKCS7 SignedData structure with m2crypto
body: <p>I am trying to use M2Crypto to extract the signing certificates from a Windows PE file. According to the MS specification the data is stored in a PKCS#7 SignedData structure (stored in ASN.1 format, not the base64). I can't seem to get the binary format to load since it is not in PEM. </p>
  
  <p>Pardon my ignorance with the crypto suites involved here, but if someone can show me the basics of how to get the signing certs out of a SignedData block I'd be most thankful!</p>
  
  <p>If it helps, i found another solution for my problem but it is in C... <a href="https://stackoverflow.com/questions/6369096/how-to-read-the-certificates-file-from-the-pkcs7-p7b-certificate-file-usind-opens">how to Read the certificates file from the PKCS7.p7b certificate file usind openssl?</a>   If i could convert that to m2crpyto i'd be set. </p>