2 * Copyright 2019 Gijs Vermeulen
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #define SPC_EXC_PE_PAGE_HASHES_FLAG 0x10
24 #define SPC_INC_PE_IMPORT_ADDR_TABLE_FLAG 0x20
25 #define SPC_INC_PE_DEBUG_INFO_FLAG 0x40
26 #define SPC_INC_PE_RESOURCES_FLAG 0x80
27 #define SPC_INC_PE_PAGE_HASHES_FLAG 0x100
29 #define SIGNER_CERT_SPC_FILE 1
30 #define SIGNER_CERT_STORE 2
31 #define SIGNER_CERT_SPC_CHAIN 3
33 #define SIGNER_CERT_POLICY_STORE 0x1
34 #define SIGNER_CERT_POLICY_CHAIN 0x2
35 #define SIGNER_CERT_POLICY_CHAIN_NO_ROOT 0x8
37 #define SIGNER_NO_ATTR 0
38 #define SIGNER_AUTHCODE_ATTR 1
40 typedef struct _SIGNER_CONTEXT
{
44 } SIGNER_CONTEXT
, *PSIGNER_CONTEXT
;
46 typedef struct _SIGNER_FILE_INFO
{
48 const WCHAR
*pwszFileName
;
50 } SIGNER_FILE_INFO
, *PSIGNER_FILE_INFO
;
52 typedef struct _SIGNER_BLOB_INFO
{
57 const WCHAR
*pwszDisplayName
;
58 } SIGNER_BLOB_INFO
, *PSIGNER_BLOB_INFO
;
60 typedef struct _SIGNER_SUBJECT_INFO
{
63 DWORD dwSubjectChoice
;
65 SIGNER_FILE_INFO
*pSignerFileInfo
;
66 SIGNER_BLOB_INFO
*pSignerBlobInfo
;
68 } SIGNER_SUBJECT_INFO
, *PSIGNER_SUBJECT_INFO
;
70 typedef struct _SIGNER_CERT_STORE_INFO
{
72 const CERT_CONTEXT
*pSigningCert
;
74 HCERTSTORE hCertStore
;
75 } SIGNER_CERT_STORE_INFO
, *PSIGNER_CERT_STORE_INFO
;
77 typedef struct _SIGNER_SPC_CHAIN_INFO
{
79 const WCHAR
*pwszSpcFile
;
81 HCERTSTORE hCertStore
;
82 } SIGNER_SPC_CHAIN_INFO
, *PSIGNER_SPC_CHAIN_INFO
;
84 typedef struct _SIGNER_CERT
{
88 const WCHAR
*pwszSpcFile
;
89 SIGNER_CERT_STORE_INFO
*pCertStoreInfo
;
90 SIGNER_SPC_CHAIN_INFO
*pSpcChainInfo
;
93 } SIGNER_CERT
, *PSIGNER_CERT
;
95 typedef struct _SIGNER_ATTR_AUTHCODE
{
99 const WCHAR
*pwszName
;
100 const WCHAR
*pwszInfo
;
101 } SIGNER_ATTR_AUTHCODE
, *PSIGNER_ATTR_AUTHCODE
;
103 typedef struct _SIGNER_SIGNATURE_INFO
{
108 SIGNER_ATTR_AUTHCODE
*pAttrAuthcode
;
110 CRYPT_ATTRIBUTES
*psAuthenticated
;
111 CRYPT_ATTRIBUTES
*psUnauthenticated
;
112 } SIGNER_SIGNATURE_INFO
, *PSIGNER_SIGNATURE_INFO
;
114 typedef struct _SIGNER_PROVIDER_INFO
{
116 const WCHAR
*pwszProviderName
;
117 DWORD dwProviderType
;
121 WCHAR
*pwszPvkFileName
;
122 WCHAR
*pwszKeyContainer
;
124 } SIGNER_PROVIDER_INFO
, *PSIGNER_PROVIDER_INFO
;