If CryptMsgCalculateEncodedLength is called and the data forĬryptMsgUpdate has already been message encoded, the appropriate object identifier (OID) is passed in pszInnerContentObjID. The type of data depends on the value of the dwMsgType parameter. The address of a structure that contains the encoding information. The pvMsgEncodeInfo parameter is the address of a CMSG_HASHED_ENCODE_INFO structure that contains the encoding information. The pvMsgEncodeInfo parameter is the address of a CMSG_ENVELOPED_ENCODE_INFO structure that contains the encoding information. The pvMsgEncodeInfo parameter is the address of a CMSG_SIGNED_ENCODE_INFO structure that contains the encoding information. This must be one of the following values. The handle is not released if the function fails. If set, the hCryptProv that is passed to this function is released on the final CryptMsgUpdate.
Applicable to both signed and enveloped messages. When set, non-data type- inner content is encapsulated within an OCTET STRING. This is particularly useful when performing streaming.
Used when calculating the size of a message that has been encoded by using Distinguished Encoding Rules (DER) and that is nested inside an enveloped message. There is detached data being supplied for the subsequent calls toĪuthenticated attributes are forced to be included in the SignerInfo (as defined by PKCS #7) in cases where they would not otherwise be required. This makes it suitable to be streamed into an enclosing message. The streamed output will not have an outer ContentInfo wrapper (as defined by PKCS #7). It is always acceptable to specify both the certificate and message encoding types by combining them with a bitwise- OR operation as shown in the following example:Ĭurrently defined dwFlags are shown in the following table. The message remains open untilĬryptMsgClose is called. The CryptMsgOpenToEncode function opens a cryptographic message for encoding and returns a handle of the opened message.