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.

87 lines
2.8 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: pertrust.h
  8. //
  9. //--------------------------------------------------------------------------
  10. //
  11. // PersonalTrustDB.h
  12. // (pertrust.h)
  13. //
  14. // Interface to the personal trust database manager
  15. #define IID_IPersonalTrustDB_Data { 0x4001b231, 0x8d76, 0x11cf, { 0xae, 0xce, 0x0, 0xaa, 0x0, 0x6c, 0x37, 0x6 } }
  16. extern "C" const GUID IID_IPersonalTrustDB;
  17. typedef struct TRUSTLISTENTRY
  18. {
  19. WCHAR szToken[MAX_PATH]; // the name of this certificate
  20. LONG iLevel; // the level at which this fellow lives in the hierarchy
  21. WCHAR szDisplayName[64]; // the display name to show in the UI
  22. } TRUSTLISTENTRY;
  23. #undef INTERFACE
  24. #define INTERFACE IPersonalTrustDB
  25. DECLARE_INTERFACE_(IPersonalTrustDB, IUnknown)
  26. {
  27. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  28. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  29. STDMETHOD_(ULONG,Release)(THIS) PURE;
  30. //
  31. // Answer whether the indicated certificate is trusted at the
  32. // indicated level of the certificate chain.
  33. //
  34. // S_OK == yes
  35. // S_FALSE == no
  36. // other == error, can't tell
  37. //
  38. STDMETHOD(IsTrustedCert)(PCCERT_CONTEXT pCert, LONG iLevel, BOOL fCommercial) PURE;
  39. //
  40. // Add the given certificate to the trust data base
  41. //
  42. STDMETHOD(AddTrustCert)(PCCERT_CONTEXT pCert, LONG iLevel, BOOL fLowerLevelsToo) PURE;
  43. //
  44. // Remove the given certificate from the trust data base
  45. //
  46. STDMETHOD(RemoveTrustCert)(PCCERT_CONTEXT pCert, LONG iLevel, BOOL fLowerLevelsToo) PURE;
  47. STDMETHOD(RemoveTrustToken)(THIS_ LPWSTR szToken, LONG iLevel, BOOL fLowerLevelsToo) PURE;
  48. //
  49. // Return the list of trusted entitities
  50. //
  51. STDMETHOD(GetTrustList)(THIS_
  52. LONG iLevel, // the cert chain level to get
  53. BOOL fLowerLevelsToo, // included lower levels, remove duplicates
  54. TRUSTLISTENTRY** prgTrustList, // place to return the trust list
  55. ULONG* pcTrustList // place to return the size of the returned trust list
  56. ) PURE;
  57. //
  58. // Answer whether commercial publishers are trusted
  59. //
  60. // S_OK == yes
  61. // S_FALSE == no
  62. // other == error, can't tell
  63. STDMETHOD(AreCommercialPublishersTrusted)(THIS) PURE;
  64. //
  65. // Set the commercial publisher trust setting
  66. //
  67. STDMETHOD(SetCommercialPublishersTrust)(THIS_ BOOL fTrusted) PURE;
  68. };
  69. //
  70. // Creation function for default implementation
  71. //
  72. HRESULT OpenTrustDB(IUnknown* punkOuter, REFIID iid, void** ppv);