SignerSignEx function
Applies to: desktop apps only
The SignerSignEx function signs the specified file and returns a pointer to the signed data.
Note This function has no associated header file or import library. To call this function, you must create a user-defined header file and use the LoadLibrary and GetProcAddress functions to dynamically link to Mssign32.dll.
Syntax
HRESULT WINAPI SignerSignEx( __in DWORD dwFlags, __in SIGNER_SUBJECT_INFO *pSubjectInfo, __in SIGNER_CERT *pSignerCert, __in SIGNER_SIGNATURE_INFO *pSignatureInfo, __in_opt SIGNER_PROVIDER_INFO *pProviderInfo, __in_opt LPCWSTR pwszHttpTimeStamp, __in_opt PCRYPT_ATTRIBUTES psRequest, __in_opt LPVOID pSipData, __out SIGNER_CONTEXT **ppSignerContext );
Parameters
- dwFlags [in]
-
Modifies the behavior of this function.
If the file to be signed is a portable executable (PE) file, this can be zero or a combination of one or more of the following values. These identifiers are defined in Mssip.h.
Value Meaning - SPC_EXC_PE_PAGE_HASHES_FLAG
- 0x10
Exclude page hashes when creating SIP indirect data for the PE file. This flag takes precedence over the SPC_INC_PE_PAGE_HASHES_FLAG flag.
If neither the SPC_EXC_PE_PAGE_HASHES_FLAG or the SPC_INC_PE_PAGE_HASHES_FLAG flag is specified, the value set with the WintrustSetDefaultIncludePEPageHashes function is used for this setting. The default for this setting is to exclude page hashes when creating SIP indirect data for PE files.
Windows Server 2003, Windows XP, and Windows 2000: This value is not supported.- SPC_INC_PE_IMPORT_ADDR_TABLE_FLAG
- 0x20
This value is not supported.
- SPC_INC_PE_DEBUG_INFO_FLAG
- 0x40
This value is not supported.
- SPC_INC_PE_RESOURCES_FLAG
- 0x80
This value is not supported.
- SPC_INC_PE_PAGE_HASHES_FLAG
- 0x100
Include page hashes when creating SIP indirect data for the PE file.
Windows Server 2003, Windows XP, and Windows 2000: This value is not supported. - pSubjectInfo [in]
-
A pointer to a SIGNER_SUBJECT_INFO structure that specifies the subject to sign.
- pSignerCert [in]
-
A pointer to a SIGNER_CERT structure that specifies the certificate to use to create the digital signature.
- pSignatureInfo [in]
-
A pointer to a SIGNER_SIGNATURE_INFO structure that contains information about the digital signature.
- pProviderInfo [in, optional]
-
A pointer to a SIGNER_PROVIDER_INFO structure that specifies the cryptographic service provider (CSP) and private key information used to create the digital signature.
If the value of this parameter is NULL, the value of the pSignerCert parameter must specify a certificate that is associated with a CSP.
- pwszHttpTimeStamp [in, optional]
-
The URL of a time stamp server.
- psRequest [in, optional]
-
A pointer to an array of CRYPT_ATTRIBUTE structures that are added to a sign request. This parameter is ignored if the pwszHttpTimeStamp parameter does not contain a valid value that is not NULL.
- pSipData [in, optional]
-
A 32-bit value that is passed as additional data to SIP functions. The format and content of this is defined by the SIP provider.
- ppSignerContext [out]
-
The address of a pointer to the SIGNER_CONTEXT structure that contains the signed BLOB. When you have finished using the SIGNER_CONTEXT structure, free the SIGNER_CONTEXT structure by calling the SignerFreeSignerContext function.
Return value
If the function succeeds, the function returns S_OK.
If the function fails, it returns an HRESULT value that indicates the error. For a list of common error codes, see Common HRESULT Values.
Requirements
|
Minimum supported client | Windows 2000 Professional |
|---|---|
|
Minimum supported server | Windows 2000 Server |
|
DLL |
|
See also
Send comments about this topic to Microsoft
Build date: 3/6/2012