i2d_PKCS7
*out_data_len = i2d_PKCS7(p7, NULL);
retval = i2d_PKCS7(p7, &p);
*signed_data_len = i2d_PKCS7(p7, NULL);