Hi,

I have a PCKS7 cert created when I signed some binary data with this command:
  openssl  smime -pk7out -sign -in myInsydeL2CertVar.dat -outform DER -nochain 
-nosigs -noverify -binary -signer mySignpfx.pem -out myInsydeL2CertVarSigned.dat

I can decode the cert with Openssl at the command line, like this:
    openssl  pkcs7 -inform DER -text -in myInsydeL2CertVarSigned.dat 
-print_certs

But when using the DER cert in my program, at this call:
    Pkcs7 = d2i_PKCS7 (NULL, &P7Data, (int)P7Length);

I get a NULL return.  Debugging into the call, I verified the cert DER data 
looks the same as I expect.  At the end of the decode function 
(ASN1_item_ex_d2i()), I see Type (it->sname) = PKCS7_SIGNED at the error return.

Any ideas why the decode works at the command line, but fails in the 
programming API?

Thanks for any thoughts,
Marty

Reply via email to