Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

153 lines
6.9 KiB

  1. //--------------------------------------------------------------
  2. // Copyright (C) Microsoft Corporation, 1996 - 1999
  3. //
  4. // File: signpvk.h
  5. //
  6. // Contents: The private include file for signing.cpp.
  7. //
  8. // History: 01-12-1997 xiaohs created
  9. //
  10. //--------------------------------------------------------------
  11. #ifndef SIGNPVK_H
  12. #define SIGNPVK_H
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #define HASH_ALG_COUNT 2
  17. #define SIGN_PVK_NO_CHAIN 1
  18. #define SIGN_PVK_CHAIN_ROOT 2
  19. #define SIGN_PVK_CHAIN_NO_ROOT 3
  20. #define SIGN_PVK_NO_ADD 1
  21. #define SIGN_PVK_ADD_FILE 2
  22. #define SIGN_PVK_ADD_STORE 3
  23. #define CSP_TYPE_NAME 200
  24. #define MAX_CONTAINER_NAME 1000
  25. #define MAX_ALG_NAME 1000
  26. #define MAX_KEY_TYPE_NAME 100
  27. typedef struct _CSP_INFO
  28. {
  29. DWORD dwCSPType;
  30. LPWSTR pwszCSPName;
  31. }CSP_INFO;
  32. //-----------------------------------------------------------------------
  33. // The struct to define the list of all stores
  34. //
  35. //-----------------------------------------------------------------------
  36. typedef struct _SIGN_CERT_STORE_LIST
  37. {
  38. DWORD dwStoreCount;
  39. HCERTSTORE *prgStore;
  40. }SIGN_CERT_STORE_LIST;
  41. //-----------------------------------------------------------------------
  42. // CERT_SIGNING_INFO
  43. //
  44. //
  45. // This struct contains everything you will ever need to signing
  46. // a file. This struct is private to the dll
  47. //------------------------------------------------------------------------
  48. typedef struct _CERT_SIGNING_INFO
  49. {
  50. UINT idsText; //output parameter
  51. DWORD dwFlags; //dwFlags from the API
  52. UINT idsMsgTitle; //the IDS for the message box title
  53. HFONT hBigBold;
  54. HFONT hBold;
  55. BOOL fFree; //Whether to free the struct
  56. BOOL fCancel; //Whether user has cliked on the cancel button
  57. BOOL fUseOption; //Whether user has requested the all signing option
  58. BOOL fCustom; //if fOption is true, whether or not use has chosen the custon option
  59. LPSTR pszHashOIDName; //the hash OID name that user has selected
  60. DWORD dwCSPCount; //the count of CSPs from the numeration
  61. CSP_INFO *pCSPInfo; //the array of CSPs from the numeration
  62. BOOL fUsePvkPage; //whether the user has enter information in the PVK page
  63. BOOL fPvkFile; //whether to use the PVK file
  64. LPWSTR pwszPvk_File; //the pvk file name
  65. LPWSTR pwszPvk_CSP; //the csp name
  66. DWORD dwPvk_CSPType; //the csp type
  67. LPWSTR pwszContainer_CSP; //the csp name
  68. DWORD dwContainer_CSPType; //the csp type
  69. LPWSTR pwszContainer_Name; //container name
  70. DWORD dwContainer_KeyType; //key spec
  71. LPWSTR pwszContainer_KeyType; //key spec name
  72. BOOL fUsageChain; //whether we have obtained user input from the page
  73. DWORD dwChainOption; //the chain options
  74. DWORD dwAddOption; //the add certificate options
  75. HCERTSTORE hAddStoreCertStore; //The additional certificate (from store) to add in the signature
  76. BOOL fFreeStoreCertStore; //whether to free the hAddStoreCertStore
  77. HCERTSTORE hAddFileCertStore; //The additional certificate (from file) to add in the signature
  78. LPWSTR pwszAddFileName; //The file name of the additional certificate file
  79. BOOL fUseDescription; //Whether we have obtained the descrition information from the user
  80. LPWSTR pwszDes; //the content description
  81. LPWSTR pwszURL; //the content URL
  82. BOOL fUsageTimeStamp; //Whether we have obtained the timestamp information from the user
  83. LPWSTR pwszTimeStamp; //The timestamp address
  84. BOOL fUseSignCert; //whether user has entered the information through the signing cert page
  85. BOOL fSignCert; //whether user has selected the signing cert, or the SPC file
  86. LPWSTR pwszSPCFileName; //The SPC file name that inclues the signing cert
  87. PCCERT_CONTEXT pSignCert; //The signing certificate
  88. DWORD dwCertStore; //the count the certificate store for the signing cert
  89. HCERTSTORE *rghCertStore; //The certificate store from which the siging cert is selected
  90. LPWSTR pwszFileName; //The file name to be signed
  91. HCERTSTORE hMyStore; //the signing certificate store
  92. BOOL fRefreshPvkOnCert; //whether to refill the private key information when SIGN_PVK page is shown
  93. }CERT_SIGNING_INFO;
  94. BOOL I_SigningWizard(PCRYPTUI_WIZ_GET_SIGN_PAGE_INFO pSignGetPageInfo);
  95. BOOL GetProviderTypeName(DWORD dwCSPType, LPWSTR wszName);
  96. BOOL SelectComboName(HWND hwndDlg,
  97. int idControl,
  98. LPWSTR pwszName);
  99. BOOL RefreshCSPType(HWND hwndDlg,
  100. int idsCSPTypeControl,
  101. int idsCSPNameControl,
  102. CERT_SIGNING_INFO *pPvkSignInfo);
  103. void SetSelectPvkFile(HWND hwndDlg);
  104. void SetSelectKeyContainer(HWND hwndDlg);
  105. BOOL InitPvkWithPvkInfo(HWND hwndDlg,
  106. CRYPTUI_WIZ_DIGITAL_SIGN_PVK_FILE_INFO *pPvkFileInfo,
  107. CERT_SIGNING_INFO *pPvkSignInfo);
  108. BOOL RefreshContainer(HWND hwndDlg,
  109. int idsContainerControl,
  110. int idsCSPNameControl,
  111. CERT_SIGNING_INFO *pPvkSignInfo);
  112. DWORD GetKeyTypeFromName(LPWSTR pwszKeyTypeName);
  113. BOOL RefreshKeyType(HWND hwndDlg,
  114. int idsKeyTypeControl,
  115. int idsContainerControl,
  116. int idsCSPNameControl,
  117. CERT_SIGNING_INFO *pPvkSignInfo);
  118. #ifdef __cplusplus
  119. } // Balance extern "C" above
  120. #endif
  121. #endif //SIGNPVK_H