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.

96 lines
3.3 KiB

  1. //+-------------------------------------------------------------------------
  2. // Microsoft Windows
  3. //
  4. // Copyright (C) Microsoft Corporation, 1996 - 1997
  5. //
  6. // File: crypthlp.h
  7. //
  8. // Contents: Misc internal crypt/certificate helper APIs
  9. //
  10. // APIs: I_CryptGetDefaultCryptProv
  11. // I_CryptGetDefaultCryptProvForEncrypt
  12. // I_CryptGetFileVersion
  13. // I_CertSyncStore
  14. //
  15. // History: 01-Jun-97 philh created
  16. //--------------------------------------------------------------------------
  17. #ifndef __CRYPTHLP_H__
  18. #define __CRYPTHLP_H__
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. //+-------------------------------------------------------------------------
  23. // Acquire default CryptProv according to the public key algorithm supported
  24. // by the provider type. The provider is acquired with only
  25. // CRYPT_VERIFYCONTEXT.
  26. //
  27. // Setting aiPubKey to 0, gets the default provider for RSA_FULL.
  28. //
  29. // Note, the returned CryptProv must not be released. Once acquired, the
  30. // CryptProv isn't released until ProcessDetach. This allows the returned
  31. // HCRYPTPROVs to be shared.
  32. //--------------------------------------------------------------------------
  33. HCRYPTPROV
  34. WINAPI
  35. I_CryptGetDefaultCryptProv(
  36. IN ALG_ID aiPubKey
  37. );
  38. //+-------------------------------------------------------------------------
  39. // Acquire default CryptProv according to the public key algorithm, encrypt
  40. // key algorithm and encrypt key length supported by the provider type.
  41. //
  42. // dwBitLen = 0, assumes the aiEncrypt's default bit length. For example,
  43. // CALG_RC2 has a default bit length of 40.
  44. //
  45. // Note, the returned CryptProv must not be released. Once acquired, the
  46. // CryptProv isn't released until ProcessDetach. This allows the returned
  47. // CryptProvs to be shared.
  48. //--------------------------------------------------------------------------
  49. HCRYPTPROV
  50. WINAPI
  51. I_CryptGetDefaultCryptProvForEncrypt(
  52. IN ALG_ID aiPubKey,
  53. IN ALG_ID aiEncrypt,
  54. IN DWORD dwBitLen
  55. );
  56. //+-------------------------------------------------------------------------
  57. // crypt32.dll release version numbers
  58. //--------------------------------------------------------------------------
  59. #define IE4_CRYPT32_DLL_VER_MS (( 5 << 16) | 101 )
  60. #define IE4_CRYPT32_DLL_VER_LS (( 1670 << 16) | 1 )
  61. //+-------------------------------------------------------------------------
  62. // Get file version of the specified file
  63. //--------------------------------------------------------------------------
  64. BOOL
  65. WINAPI
  66. I_CryptGetFileVersion(
  67. IN LPCWSTR pwszFilename,
  68. OUT DWORD *pdwFileVersionMS, /* e.g. 0x00030075 = "3.75" */
  69. OUT DWORD *pdwFileVersionLS /* e.g. 0x00000031 = "0.31" */
  70. );
  71. //+-------------------------------------------------------------------------
  72. // Synchronize the original store with the new store.
  73. //
  74. // Assumptions: Both are cache stores. The new store is temporary
  75. // and local to the caller. The new store's contexts can be deleted or
  76. // moved to the original store.
  77. //--------------------------------------------------------------------------
  78. BOOL
  79. WINAPI
  80. I_CertSyncStore(
  81. IN OUT HCERTSTORE hOriginalStore,
  82. IN OUT HCERTSTORE hNewStore
  83. );
  84. #ifdef __cplusplus
  85. } // Balance extern "C" above
  86. #endif
  87. #endif