CryptSIPPutSignedDataMsg function (mssip.h)

The CryptSIPPutSignedDataMsg function stores an Authenticode signature in the target file.

Syntax

BOOL CryptSIPPutSignedDataMsg(
  [in]  SIP_SUBJECTINFO *pSubjectInfo,
  [in]  DWORD           dwEncodingType,
  [out] DWORD           *pdwIndex,
  [in]  DWORD           cbSignedDataMsg,
  [in]  BYTE            *pbSignedDataMsg
);

Parameters

[in] pSubjectInfo

Pointer to a SIP_SUBJECTINFO structure that contains information about the message subject.

[in] dwEncodingType

The encoding type of the message. This can be a combination of one or more of the following values.

Value Meaning
PKCS_7_ASN_ENCODING
65536 (0x10000)
Specifies PKCS #7 message encoding.
X509_ASN_ENCODING
1 (0x1)
Specifies X.509 certificate encoding.

[out] pdwIndex

Pointer to the message index.

[in] cbSignedDataMsg

Length, in bytes, of the buffer pointed to by the pbSignedDataMsg parameter.

[in] pbSignedDataMsg

Pointer to the buffer that contains the message.

Return value

If the function succeeds, the function returns TRUE.

If the function fails, it returns FALSE. For extended error information, call GetLastError. Some possible error codes follow.

Return code Description
ERROR_BAD_FORMAT
The specified data or file format of the subject interface package (SIP) is not valid.
ERROR_INVALID_PARAMETER
This code can be returned for the following reasons:
  • The pSubjectInfo is NULL.
  • The pdwIndex is NULL.
  • The pbSignedDataMsg is NULL.
  • The value of the cbSignedDataMsg parameter is less than one.
  • [SIP_SUBJECTINFO](/windows/desktop/api/mssip/ns-mssip-sip_subjectinfo) structure. [SIP_SUBJECTINFO](/windows/desktop/api/mssip/ns-mssip-sip_subjectinfo) structure.
TRUST_E_SUBJECT_FORM_UNKNOWN
The specified subject type is not valid.

Remarks

Each subject type uses a different subset of its data for hash calculation and requires a different procedure for storage and retrieval. Therefore, each subject type has a unique SIP specification.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header mssip.h
Library Crypt32.lib
DLL Crypt32.dll

See also

CryptSIPGetSignedDataMsg

CryptSIPRemoveSignedDataMsg