all encryption/message digests are applied to the 'contents', leaving out the 'type' field.
NID_pkcs7_data
NID_pkcs7_digest
NID_pkcs7_encrypted
NID_pkcs7_enveloped
Anything else
NID_pkcs7_signed
NID_pkcs7_signedAndEnveloped
See Implementation
all encryption/message digests are applied to the 'contents', leaving out the 'type' field.