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.

288 lines
4.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. // File: wincrypt.h
  7. //
  8. // Contents: Cryptographic API Prototypes and Definitions
  9. //
  10. //----------------------------------------------------------------------------
  11. #ifndef __SWINCRYP_H__
  12. #define __SWINCRYP_H__
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. BOOL
  17. WINAPI
  18. SCryptAcquireContextA(
  19. HCRYPTPROV *phProv,
  20. LPCSTR pszContainer,
  21. LPCSTR pszProvider,
  22. DWORD dwProvType,
  23. DWORD dwFlags);
  24. BOOL
  25. WINAPI
  26. SCryptAcquireContextW(
  27. HCRYPTPROV *phProv,
  28. LPCWSTR pszContainer,
  29. LPCWSTR pszProvider,
  30. DWORD dwProvType,
  31. DWORD dwFlags);
  32. #ifdef UNICODE
  33. #define SCryptAcquireContext SCryptAcquireContextW
  34. #else
  35. #define SCryptAcquireContext SCryptAcquireContextA
  36. #endif // !UNICODE
  37. BOOL
  38. WINAPI
  39. SCryptReleaseContext(
  40. HCRYPTPROV hProv,
  41. DWORD dwFlags);
  42. BOOL
  43. WINAPI
  44. SCryptGenKey(
  45. HCRYPTPROV hProv,
  46. ALG_ID Algid,
  47. DWORD dwFlags,
  48. HCRYPTKEY *phKey);
  49. BOOL
  50. WINAPI
  51. SCryptDuplicateKey(
  52. HCRYPTKEY hKey,
  53. DWORD *pdwReserved,
  54. DWORD dwFlags,
  55. HCRYPTKEY * phKey);
  56. BOOL
  57. WINAPI
  58. SCryptDeriveKey(
  59. HCRYPTPROV hProv,
  60. ALG_ID Algid,
  61. HCRYPTHASH hBaseData,
  62. DWORD dwFlags,
  63. HCRYPTKEY *phKey);
  64. BOOL
  65. WINAPI
  66. SCryptDestroyKey(
  67. HCRYPTKEY hKey);
  68. BOOL
  69. WINAPI
  70. SCryptSetKeyParam(
  71. HCRYPTKEY hKey,
  72. DWORD dwParam,
  73. BYTE *pbData,
  74. DWORD dwFlags);
  75. BOOL
  76. WINAPI
  77. SCryptGetKeyParam(
  78. HCRYPTKEY hKey,
  79. DWORD dwParam,
  80. BYTE *pbData,
  81. DWORD *pdwDataLen,
  82. DWORD dwFlags);
  83. BOOL
  84. WINAPI
  85. SCryptSetHashParam(
  86. HCRYPTHASH hHash,
  87. DWORD dwParam,
  88. BYTE *pbData,
  89. DWORD dwFlags);
  90. BOOL
  91. WINAPI
  92. SCryptGetHashParam(
  93. HCRYPTHASH hHash,
  94. DWORD dwParam,
  95. BYTE *pbData,
  96. DWORD *pdwDataLen,
  97. DWORD dwFlags);
  98. BOOL
  99. WINAPI
  100. SCryptSetProvParam(
  101. HCRYPTPROV hProv,
  102. DWORD dwParam,
  103. BYTE *pbData,
  104. DWORD dwFlags);
  105. BOOL
  106. WINAPI
  107. SCryptGetProvParam(
  108. HCRYPTPROV hProv,
  109. DWORD dwParam,
  110. BYTE *pbData,
  111. DWORD *pdwDataLen,
  112. DWORD dwFlags);
  113. BOOL
  114. WINAPI
  115. SCryptGenRandom(
  116. HCRYPTPROV hProv,
  117. DWORD dwLen,
  118. BYTE *pbBuffer);
  119. BOOL
  120. WINAPI
  121. SCryptGetUserKey(
  122. HCRYPTPROV hProv,
  123. DWORD dwKeySpec,
  124. HCRYPTKEY *phUserKey);
  125. BOOL
  126. WINAPI
  127. SCryptExportKey(
  128. HCRYPTKEY hKey,
  129. HCRYPTKEY hExpKey,
  130. DWORD dwBlobType,
  131. DWORD dwFlags,
  132. BYTE *pbData,
  133. DWORD *pdwDataLen);
  134. BOOL
  135. WINAPI
  136. SCryptImportKey(
  137. HCRYPTPROV hProv,
  138. CONST BYTE *pbData,
  139. DWORD dwDataLen,
  140. HCRYPTKEY hPubKey,
  141. DWORD dwFlags,
  142. HCRYPTKEY *phKey);
  143. BOOL
  144. WINAPI
  145. SCryptEncrypt(
  146. HCRYPTKEY hKey,
  147. HCRYPTHASH hHash,
  148. BOOL Final,
  149. DWORD dwFlags,
  150. BYTE *pbData,
  151. DWORD *pdwDataLen,
  152. DWORD dwBufLen);
  153. BOOL
  154. WINAPI
  155. SCryptDecrypt(
  156. HCRYPTKEY hKey,
  157. HCRYPTHASH hHash,
  158. BOOL Final,
  159. DWORD dwFlags,
  160. BYTE *pbData,
  161. DWORD *pdwDataLen);
  162. BOOL
  163. WINAPI
  164. SCryptCreateHash(
  165. HCRYPTPROV hProv,
  166. ALG_ID Algid,
  167. HCRYPTKEY hKey,
  168. DWORD dwFlags,
  169. HCRYPTHASH *phHash);
  170. BOOL
  171. WINAPI
  172. SCryptDuplicateHash(
  173. HCRYPTHASH hHash,
  174. DWORD *pdwReserved,
  175. DWORD dwFlags,
  176. HCRYPTHASH * phHash);
  177. BOOL
  178. WINAPI
  179. SCryptHashData(
  180. HCRYPTHASH hHash,
  181. CONST BYTE *pbData,
  182. DWORD dwDataLen,
  183. DWORD dwFlags);
  184. BOOL
  185. WINAPI
  186. SCryptHashSessionKey(
  187. HCRYPTHASH hHash,
  188. HCRYPTKEY hKey,
  189. DWORD dwFlags);
  190. BOOL
  191. WINAPI
  192. SCryptGetHashValue(
  193. HCRYPTHASH hHash,
  194. DWORD dwFlags,
  195. BYTE *pbHash,
  196. DWORD *pdwHashLen);
  197. BOOL
  198. WINAPI
  199. SCryptDestroyHash(
  200. HCRYPTHASH hHash);
  201. BOOL
  202. WINAPI
  203. SCryptSignHashA(
  204. HCRYPTHASH hHash,
  205. DWORD dwKeySpec,
  206. LPCSTR sDescription,
  207. DWORD dwFlags,
  208. BYTE *pbSignature,
  209. DWORD *pdwSigLen);
  210. BOOL
  211. WINAPI
  212. SCryptSignHashW(
  213. HCRYPTHASH hHash,
  214. DWORD dwKeySpec,
  215. LPCWSTR sDescription,
  216. DWORD dwFlags,
  217. BYTE *pbSignature,
  218. DWORD *pdwSigLen);
  219. #ifdef UNICODE
  220. #define SCryptSignHash SCryptSignHashW
  221. #else
  222. #define SCryptSignHash SCryptSignHashA
  223. #endif // !UNICODE
  224. BOOL
  225. WINAPI
  226. SCryptVerifySignatureA(
  227. HCRYPTHASH hHash,
  228. CONST BYTE *pbSignature,
  229. DWORD dwSigLen,
  230. HCRYPTKEY hPubKey,
  231. LPCSTR sDescription,
  232. DWORD dwFlags);
  233. BOOL
  234. WINAPI
  235. SCryptVerifySignatureW(
  236. HCRYPTHASH hHash,
  237. CONST BYTE *pbSignature,
  238. DWORD dwSigLen,
  239. HCRYPTKEY hPubKey,
  240. LPCWSTR sDescription,
  241. DWORD dwFlags);
  242. #ifdef UNICODE
  243. #define SCryptVerifySignature SCryptVerifySignatureW
  244. #else
  245. #define SCryptVerifySignature SCryptVerifySignatureA
  246. #endif // !UNICODE
  247. #ifdef __cplusplus
  248. } // Balance extern "C" above
  249. #endif
  250. #endif // __SWINCRYP_H__