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.

128 lines
5.5 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: cautil.h
  8. //
  9. //--------------------------------------------------------------------------
  10. //header file for utility functions
  11. //--------------------------------------------------------------------
  12. //
  13. // CAUtilGetCADisplayName
  14. //
  15. // Get the display name of the CA based on its real name
  16. //
  17. //--------------------------------------------------------------------
  18. BOOL CAUtilGetCADisplayName(DWORD dwCAFindFlags,
  19. LPWSTR pwszCAName,
  20. LPWSTR *ppwszCADisplayName);
  21. //--------------------------------------------------------------------
  22. //
  23. // Verify that the user has the correct permision to
  24. // ask for the requested certificatd types
  25. //
  26. //--------------------------------------------------------------------
  27. BOOL CAUtilValidCertType(PCCRYPTUI_WIZ_CERT_REQUEST_INFO pCertRequestInfo,
  28. CERT_WIZARD_INFO *pCertWizardInfo);
  29. BOOL CAUtilValidCertTypeNoDS(HCERTTYPE hCertType,
  30. LPWSTR pwszCertDNName,
  31. CERT_WIZARD_INFO *pCertWizardInfo);
  32. //--------------------------------------------------------------------
  33. //
  34. //Retrieve a list of CAs what supports the required certificate types
  35. //
  36. // The CA returned will support all the certificate types required.
  37. // 1. Check the permission
  38. // 2. Check for the subject name
  39. //
  40. // The CA returned will also support the CSP that user specified
  41. // 1. If the CSP type is selected, then use it
  42. // 1.1 If the CSP type is not sepecified and UILess mode, use RSA_FULL
  43. // 1.2 If the CSP type is not sepecified and UI mode, no need to check
  44. //---------------------------------------------------------------------
  45. BOOL CAUtilRetrieveCAFromCertType(
  46. CERT_WIZARD_INFO *pCertWizardInfo,
  47. PCCRYPTUI_WIZ_CERT_REQUEST_INFO pCertRequestInfo,
  48. BOOL fMultipleCA, //only need one CA
  49. DWORD dwNameFlag,
  50. DWORD *pdwCACount,
  51. LPWSTR **ppwszCALocation,
  52. LPWSTR **ppwszCAName);
  53. //--------------------------------------------------------------------
  54. //
  55. //Based on the CA name and CA location, get a list of certificate type
  56. //and their extensions
  57. //
  58. //---------------------------------------------------------------------
  59. BOOL CAUtilGetCertTypeNameAndExtensionsNoDS
  60. (CERT_WIZARD_INFO *pCertWizardInfo,
  61. LPWSTR pwszCertDNName,
  62. HCERTTYPE hCertType,
  63. LPWSTR *pwszCertType,
  64. LPWSTR *ppwszDisplayCertType,
  65. PCERT_EXTENSIONS *pCertExtensions,
  66. DWORD *pdwKeySpec,
  67. DWORD *pdwMinKeySize,
  68. DWORD *pdwCSPCount,
  69. DWORD **ppdwCSPList,
  70. DWORD *pdwRASignature,
  71. DWORD *pdwEnrollmentFlags,
  72. DWORD *pdwSubjectNameFlags,
  73. DWORD *pdwPrivateKeyFlags,
  74. DWORD *pdwGeneralFlags);
  75. BOOL CAUtilGetCertTypeNameAndExtensions(
  76. CERT_WIZARD_INFO *pCertWizardInfo,
  77. PCCRYPTUI_WIZ_CERT_REQUEST_INFO pCertRequestInfo,
  78. LPWSTR pwszCALocation,
  79. LPWSTR pwszCAName,
  80. DWORD *pdwCertType,
  81. LPWSTR **ppwszCertType,
  82. LPWSTR **ppwszDisplayCertType,
  83. PCERT_EXTENSIONS **ppCertExtensions,
  84. DWORD **ppdwKeySpec,
  85. DWORD **ppdwCertTypeFlag,
  86. DWORD **ppdwCSPCount,
  87. DWORD ***ppdwCSPList,
  88. DWORD **ppdwRASignature,
  89. DWORD **ppdwEnrollmentFlags,
  90. DWORD **ppdwSubjectNameFlags,
  91. DWORD **ppdwPrivateKeyFlags,
  92. DWORD **ppdwGeneralFlags
  93. );
  94. //--------------------------------------------------------------------
  95. //
  96. //Retrieve the CA information based on a certificate
  97. //
  98. //---------------------------------------------------------------------
  99. BOOL CAUtilRetrieveCAFromCert(
  100. CERT_WIZARD_INFO *pCertWizardInfo,
  101. PCCRYPTUI_WIZ_CERT_REQUEST_INFO pCertRequestInfo,
  102. LPWSTR *pwszCALocation,
  103. LPWSTR *pwszCAName);
  104. //--------------------------------------------------------------------
  105. //
  106. //From the API's cert type name, get the real name with GUID
  107. //
  108. //---------------------------------------------------------------------
  109. BOOL CAUtilGetCertTypeName(CERT_WIZARD_INFO *pCertWizardInfo,
  110. LPWSTR pwszAPIName,
  111. LPWSTR *ppwszCTName);
  112. BOOL CAUtilGetCertTypeNameNoDS(IN HCERTTYPE hCertType,
  113. OUT LPWSTR *ppwszCTName);