Source code of Windows XP (NT5)
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.

199 lines
9.1 KiB

  1. //depot/Lab03_N/DS/security/inc/keysvcc.h#8 - edit change 8790 (text)
  2. //depot/Lab03_N/DS/security/inc/keysvcc.h#5 - edit change 6380 (text)
  3. //+-------------------------------------------------------------------------
  4. //
  5. // Microsoft Windows
  6. //
  7. // Copyright (C) Microsoft Corporation, 1997 - 1999
  8. //
  9. // File: keysvcc.h
  10. //
  11. //--------------------------------------------------------------------------
  12. #ifndef __keysvcc_h__
  13. #define __keysvcc_h__
  14. #ifdef __cplusplus
  15. extern "C"{
  16. #endif
  17. #define KEYSVC_DEFAULT_ENDPOINT TEXT("\\pipe\\keysvc")
  18. #define KEYSVC_DEFAULT_PROT_SEQ TEXT("ncacn_np")
  19. #define KEYSVC_LOCAL_ENDPOINT TEXT("keysvc")
  20. #define KEYSVC_LOCAL_PROT_SEQ TEXT("ncalrpc")
  21. #define KEYSVC_LEGACY_ENDPOINT TEXT("\\pipe\\ntsvcs")
  22. #define KEYSVC_LEGACY_PROT_SEQ TEXT("ncacn_np")
  23. typedef void *KEYSVCC_HANDLE;
  24. /****************************************
  25. * Client API for Key Service
  26. ****************************************/
  27. ULONG KeyOpenKeyService(
  28. /* [in] */ LPSTR pszMachineName,
  29. /* [in] */ KEYSVC_TYPE ulOwnerType,
  30. /* [in] */ LPWSTR pwszOwnerName,
  31. /* [in] */ void *pAuthentication,
  32. /* [out][in] */ void *pReserved,
  33. /* [out] */ KEYSVCC_HANDLE *phKeySvcCli);
  34. ULONG KeyEnumerateProviders(
  35. /* [in] */ KEYSVCC_HANDLE hKeySvcCli,
  36. /* [out][in] */ void *pReserved,
  37. /* [out][in] */ ULONG *pcProviderCount,
  38. /* [size_is][size_is][out][in] */ PKEYSVC_PROVIDER_INFO *ppProviders);
  39. ULONG KeyEnumerateProviderTypes(
  40. /* [in] */ KEYSVCC_HANDLE hKeySvcCli,
  41. /* [out][in] */ void *pReserved,
  42. /* [out][in] */ ULONG *pcProviderCount,
  43. /* [size_is][size_is][out][in] */ PKEYSVC_PROVIDER_INFO *ppProviders);
  44. ULONG KeyEnumerateProvContainers(
  45. /* [in] */ KEYSVCC_HANDLE hKeySvcCli,
  46. /* [in] */ KEYSVC_PROVIDER_INFO Provider,
  47. /* [in, out] */ void *pReserved,
  48. /* [in, out] */ ULONG *pcContainerCount,
  49. /* [in, out][size_is(,*pcContainerCount)] */
  50. PKEYSVC_UNICODE_STRING *ppContainers);
  51. ULONG KeyCloseKeyService(
  52. /* [in] */ KEYSVCC_HANDLE hKeySvcCli,
  53. /* [out][in] */ void *pReserved);
  54. ULONG KeyGetDefaultProvider(
  55. /* [in] */ KEYSVCC_HANDLE hKeySvcCli,
  56. /* [in] */ ULONG ulProvType,
  57. /* [in] */ ULONG ulFlags,
  58. /* [out][in] */ void *pReserved,
  59. /* [out] */ ULONG *pulDefType,
  60. /* [out] */ PKEYSVC_PROVIDER_INFO *ppProvider);
  61. ULONG KeySetDefaultProvider(
  62. /* [in] */ KEYSVCC_HANDLE hKeySvcCli,
  63. /* [in] */ ULONG ulFlags,
  64. /* [out][in] */ void *pReserved,
  65. /* [in] */ KEYSVC_PROVIDER_INFO Provider);
  66. ULONG KeyEnroll(
  67. /* [in] */ KEYSVCC_HANDLE hKeySvcCli,
  68. /* [in] */ LPSTR pszMachineName, //IN Required: name of the remote machine
  69. /* [in] */ BOOL fKeyService, //IN Required: Whether the function is called remotely
  70. /* [in] */ DWORD dwPurpose, //IN Required: Indicates type of request - enroll/renew
  71. /* [in] */ LPWSTR pwszAcctName, //IN Optional: Account name the service runs under
  72. /* [in] */ void *pAuthentication, //RESERVED must be NULL
  73. /* [in] */ BOOL fEnroll, //IN Required: Whether it is enrollment or renew
  74. /* [in] */ LPWSTR pwszCALocation, //IN Required: The ca machine name
  75. /* [in] */ LPWSTR pwszCAName, //IN Required: The ca name
  76. /* [in] */ BOOL fNewKey, //IN Required: Set the TRUE if new private key is needed
  77. /* [in] */ PCERT_REQUEST_PVK_NEW pKeyNew, //IN Required: The private key information
  78. /* [in] */ CERT_BLOB *pCert, //IN Optional: The old certificate if renewing
  79. /* [in] */ PCERT_REQUEST_PVK_NEW pRenewKey, //IN Optional: The new private key information
  80. /* [in] */ LPWSTR pwszHashAlg, //IN Optional: The hash algorithm
  81. /* [in] */ LPWSTR pwszDesStore, //IN Optional: The destination store
  82. /* [in] */ DWORD dwStoreFlags, //IN Optional: Flags for cert store.
  83. /* [in] */ PCERT_ENROLL_INFO pRequestInfo, //IN Required: The information about the cert request
  84. /* [in] */ LPWSTR pwszAttributes, //IN Optional: Attribute string for request
  85. /* [in] */ DWORD dwFlags, //RESERVED must be 0
  86. /* [in] */ BYTE *pReserved, //RESERVED must be NULL
  87. /* [out] */ CERT_BLOB *pPKCS7Blob, //OUT Optional: The PKCS7 from the CA
  88. /* [out] */ CERT_BLOB *pHashBlob, //OUT Optioanl: The SHA1 hash of the enrolled/renewed certificate
  89. /* [out] */ DWORD *pdwStatus); //OUT Optional: The status of the enrollment/renewal
  90. ULONG KeyEnroll_V2(
  91. /* [in] */ KEYSVCC_HANDLE hKeySvcCli,
  92. /* [in] */ LPSTR pszMachineName, //IN Required: name of the remote machine
  93. /* [in] */ BOOL fKeyService, //IN Required: Whether the function is called remotely
  94. /* [in] */ DWORD dwPurpose, //IN Required: Indicates type of request - enroll/renew
  95. /* [in] */ DWORD dwFlags, //IN Required: Flags for enrollment
  96. /* [in] */ LPWSTR pwszAcctName, //IN Optional: Account name the service runs under
  97. /* [in] */ void *pAuthentication, //RESERVED must be NULL
  98. /* [in] */ BOOL fEnroll, //IN Required: Whether it is enrollment or renew
  99. /* [in] */ LPWSTR pwszCALocation, //IN Required: The ca machine names to attempt to enroll with
  100. /* [in] */ LPWSTR pwszCAName, //IN Required: The ca names to attempt to enroll with
  101. /* [in] */ BOOL fNewKey, //IN Required: Set the TRUE if new private key is needed
  102. /* [in] */ PCERT_REQUEST_PVK_NEW pKeyNew, //IN Required: The private key information
  103. /* [in] */ CERT_BLOB *pCert, //IN Optional: The old certificate if renewing
  104. /* [in] */ PCERT_REQUEST_PVK_NEW pRenewKey, //IN Optional: The new private key information
  105. /* [in] */ LPWSTR pwszHashAlg, //IN Optional: The hash algorithm
  106. /* [in] */ LPWSTR pwszDesStore, //IN Optional: The destination store
  107. /* [in] */ DWORD dwStoreFlags, //IN Optional: Flags for cert store.
  108. /* [in] */ PCERT_ENROLL_INFO pRequestInfo, //IN Required: The information about the cert request
  109. /* [in] */ LPWSTR pwszAttributes, //IN Optional: Attribute string for request
  110. /* [in] */ DWORD dwReservedFlags, //RESERVED must be 0
  111. /* [in] */ BYTE *pReserved, //RESERVED must be NULL
  112. /* [in][out] */ HANDLE *phRequest, //IN OUT Optional: A handle to a created request
  113. /* [out] */ CERT_BLOB *pPKCS7Blob, //OUT Optional: The PKCS7 from the CA
  114. /* [out] */ CERT_BLOB *pHashBlob, //OUT Optioanl: The SHA1 hash of the enrolled/renewed certificate
  115. /* [out] */ DWORD *pdwStatus); //OUT Optional: The status of the enrollment/renewal
  116. ULONG KeyExportCert(
  117. /* [in] */ KEYSVCC_HANDLE hKeySvcCli,
  118. /* [in] */ LPWSTR pwszPassword,
  119. /* [in] */ LPWSTR pwszCertStore,
  120. /* [in] */ ULONG cHashCount,
  121. /* [size_is][in] */ KEYSVC_CERT_HASH *pHashes,
  122. /* [in] */ ULONG ulFlags,
  123. /* [in, out] */ void *pReserved,
  124. /* [out] */ PKEYSVC_BLOB *ppPFXBlob);
  125. ULONG KeyImportCert(
  126. /* [in] */ KEYSVCC_HANDLE hKeySvcCli,
  127. /* [in] */ LPWSTR pwszPassword,
  128. /* [in] */ LPWSTR pwszCertStore,
  129. /* [in] */ PKEYSVC_BLOB pPFXBlob,
  130. /* [in] */ ULONG ulFlags,
  131. /* [in, out] */ void *pReserved);
  132. ULONG KeyEnumerateAvailableCertTypes(
  133. /* [in] */ KEYSVCC_HANDLE hKeySvcCli,
  134. /* [out][in] */ void *pReserved,
  135. /* [out][in] */ ULONG *pcCertTypeCount,
  136. /* [in, out][size_is(,*pcCertTypeCount)] */
  137. PKEYSVC_UNICODE_STRING *ppCertTypes);
  138. ULONG KeyEnumerateCAs(
  139. /* [in] */ KEYSVCC_HANDLE hKeySvcCli,
  140. /* [out][in] */ void *pReserved,
  141. /* [in] */ ULONG ulFlags,
  142. /* [out][in] */ ULONG *pcCACount,
  143. /* [in, out][size_is(,*pcCACount)] */
  144. PKEYSVC_UNICODE_STRING *ppCAs);
  145. ULONG KeyQueryRequestStatus
  146. (/* [in] */ KEYSVCC_HANDLE hKeySvcCli,
  147. /* [in] */ HANDLE hRequest,
  148. /* [out, ref] */ CRYPTUI_WIZ_QUERY_CERT_REQUEST_INFO *pQueryInfo);
  149. ULONG RKeyOpenKeyService
  150. ( /* [in] */ LPSTR pszMachineName,
  151. /* [in] */ KEYSVC_TYPE OwnerType,
  152. /* [in] */ LPWSTR pwszOwnerName,
  153. /* [in] */ void *pAuthentication,
  154. /* [out][in] */ void *pReserved,
  155. /* [out] */ KEYSVCC_HANDLE *phKeySvcCli);
  156. ULONG RKeyCloseKeyService
  157. (/* [in] */ KEYSVCC_HANDLE hKeySvcCli,
  158. /* [out][in] */ void *pReserved);
  159. ULONG RKeyPFXInstall
  160. (/* [in] */ KEYSVCC_HANDLE hKeySvcCli,
  161. /* [in] */ PKEYSVC_BLOB pPFX,
  162. /* [in] */ PKEYSVC_UNICODE_STRING pPassword,
  163. /* [in] */ ULONG ulFlags);
  164. #ifdef __cplusplus
  165. }
  166. #endif
  167. #endif