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.

125 lines
8.4 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1999
  5. //
  6. // File: lenroll.h
  7. //
  8. // Contents: The header for LocalEnroll API. It is used
  9. // by keyservice for remote certificate enrollment.
  10. //
  11. //----------------------------------------------------------------------------
  12. #ifndef __LENROLL_H__
  13. #define __LENROLL_H__
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. //-----------------------------------------------------------------------
  18. //
  19. // LocalEnroll
  20. //
  21. //
  22. // The routine that calls xEnroll and CA to request a certificate
  23. // This routine also provide confirmation dialogue
  24. //------------------------------------------------------------------------
  25. //-----------------------------------------------------------------------
  26. // CERT_ENROLL_INFO
  27. //
  28. //------------------------------------------------------------------------
  29. typedef struct _CERT_ENROLL_INFO
  30. {
  31. DWORD dwSize; //Required: Set to the sizeof(CERT_REQUEST_INFO_W)
  32. LPCWSTR pwszUsageOID; //Required: A list of comma seperated key usage oid of the certificate
  33. LPCWSTR pwszCertDNName; //Required: The certificate CN name
  34. DWORD dwPostOption; //Required: A bit wise OR of the following value:
  35. // REQUEST_POST_ON_DS
  36. // REQUEST_POST_ON_CSP
  37. LPCWSTR pwszFriendlyName; //Optional: The friendly name of the certificate
  38. LPCWSTR pwszDescription; //Optional: The description of the certificate
  39. DWORD dwExtensions; //Optional: The count of PCERT_EXTENSIONS array for the certificate request
  40. PCERT_EXTENSIONS *prgExtensions; //Optional: the PCERT_EXTENSIONS array
  41. }CERT_ENROLL_INFO, *PCERT_ENROLL_INFO;
  42. ///-----------------------------------------------------------------------
  43. // CERT_REQUEST_PVK_NEW
  44. //
  45. //------------------------------------------------------------------------
  46. typedef struct _CERT_REQUEST_PVK_NEW
  47. {
  48. DWORD dwSize; //Required: Set to the sizeof(CERT_REQUEST_PVK_EXISTING)
  49. DWORD dwProvType; //Optional: The provider type. If this field
  50. // is 0, pwszProvider is ignored
  51. LPCWSTR pwszProvider; //Optional: The name of the provider.
  52. // NULL means the default
  53. DWORD dwProviderFlags; //Optional: The flag passed to CryptAcquireContext
  54. LPCWSTR pwszKeyContainer; //Optional: The private key container. If this value is NULL,
  55. // a new key container will be generated. Its name is guaranteed
  56. // to be unique.
  57. DWORD dwKeySpec; //Optional: The key specification of the private key
  58. DWORD dwGenKeyFlags; //Optional: The flags for CryptGenKey
  59. DWORD dwEnrollmentFlags; //Optional: The enrollment cert type flags for this cert request.
  60. DWORD dwSubjectNameFlags; //Optional: The subject name cert type flags for this cert request.
  61. DWORD dwPrivateKeyFlags; //Optional: The private key cert type flags for this cert request.
  62. DWORD dwGeneralFlags; //Optional: The general cert type flags for this cert request.
  63. }CERT_REQUEST_PVK_NEW, *PCERT_REQUEST_PVK_NEW;
  64. HRESULT WINAPI LocalEnroll( DWORD dwFlags, //IN Required
  65. LPCWSTR pRequestString, //IN Optional
  66. void *pReserved, //IN Optional
  67. BOOL fKeyService, //IN Required: Whether the function is called remotely
  68. DWORD dwPurpose, //IN Required: Whether it is enrollment or renew
  69. BOOL fConfirmation, //IN Required: Set the TRUE if confirmation dialogue is needed
  70. HWND hwndParent, //IN Optional: The parent window
  71. LPWSTR pwszConfirmationTitle, //IN Optional: The title for confirmation dialogue
  72. UINT idsConfirmTitle, //IN Optional: The resource ID for the title of the confirmation dialogue
  73. LPWSTR pwszCALocation, //IN Required: The ca machine name
  74. LPWSTR pwszCAName, //IN Required: The ca name
  75. CERT_BLOB *pCertBlob, //IN Required: The renewed certifcate
  76. CERT_REQUEST_PVK_NEW *pRenewKey, //IN Required: The private key on the certificate
  77. BOOL fNewKey, //IN Required: Set the TRUE if new private key is needed
  78. CERT_REQUEST_PVK_NEW *pKeyNew, //IN Required: The private key information
  79. LPWSTR pwszHashAlg, //IN Optional: The hash algorithm
  80. LPWSTR pwszDesStore, //IN Optional: The destination store
  81. DWORD dwStoreFlags, //IN Optional: The store flags
  82. CERT_ENROLL_INFO *pRequestInfo, //IN Required: The information about the cert request
  83. CERT_BLOB *pPKCS7Blob, //OUT Optional: The PKCS7 from the CA
  84. CERT_BLOB *pHashBlob, //OUT Optioanl: The SHA1 hash of the enrolled/renewed certificate
  85. DWORD *pdwStatus, //OUT Optional: The status of the enrollment/renewal
  86. PCERT_CONTEXT *ppCertContext //OUT Optional: The enrolled certificate
  87. );
  88. HRESULT WINAPI LocalEnrollNoDS( DWORD dwFlags, //IN Required
  89. LPCWSTR pRequestString, // Reserved: must be NULL.
  90. void *pReserved, //IN Optional
  91. BOOL fKeyService, //IN Required: Whether the function is called remotely
  92. DWORD dwPurpose, //IN Required: Whether it is enrollment or renew
  93. BOOL fConfirmation, //IN Required: Set the TRUE if confirmation dialogue is needed
  94. HWND hwndParent, //IN Optional: The parent window
  95. LPWSTR pwszConfirmationTitle, //IN Optional: The title for confirmation dialogue
  96. UINT idsConfirmTitle, //IN Optional: The resource ID for the title of the confirmation dialogue
  97. LPWSTR pwszCALocation, //IN Required: The ca machine name
  98. LPWSTR pwszCAName, //IN Required: The ca name
  99. CERT_BLOB *pCertBlob, //IN Required: The renewed certifcate
  100. CERT_REQUEST_PVK_NEW *pRenewKey, //IN Required: The private key on the certificate
  101. BOOL fNewKey, //IN Required: Set the TRUE if new private key is needed
  102. CERT_REQUEST_PVK_NEW *pKeyNew, //IN Required: The private key information
  103. LPWSTR pwszHashAlg, //IN Optional: The hash algorithm
  104. LPWSTR pwszDesStore, //IN Optional: The destination store
  105. DWORD dwStoreFlags, //IN Optional: The store flags
  106. CERT_ENROLL_INFO *pRequestInfo, //IN Required: The information about the cert request
  107. CERT_BLOB *pPKCS7Blob, //OUT Optional: The PKCS7 from the CA
  108. CERT_BLOB *pHashBlob, //OUT Optioanl: The SHA1 hash of the enrolled/renewed certificate
  109. DWORD *pdwStatus, //OUT Optional: The status of the enrollment/renewal
  110. HANDLE *pResult //OUT Optional: The enrolled certificate
  111. );
  112. #ifdef __cplusplus
  113. } // Balance extern "C" above
  114. #endif
  115. #endif // _LENROLL_H_