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.

104 lines
3.0 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996 - 1999
  5. //
  6. // File: oidmgr.h
  7. //
  8. // Contents: Declaration of oidmgr.cpp
  9. //
  10. // History: 2-17-00 xiaohs Created
  11. //
  12. //---------------------------------------------------------------------------
  13. #ifndef __OIDMGR_H__
  14. #define __OIDMGR_H__
  15. //---------------------------------------------------------------------------
  16. //
  17. // Constants
  18. //
  19. //---------------------------------------------------------------------------
  20. #define OID_CONTAINER_PROP_OID OID_PROP_OID
  21. #define OID_CONTAINER_PROP_GUID L"objectGUID"
  22. #define wszOID_DOT L"."
  23. #define wszOID_ENTERPRISE_ROOT TEXT(szOID_ENTERPRISE_OID_ROOT)
  24. //the GUID string is in the form of DWORD.DWORD.DWORD.DWORD
  25. #define DWORD_STRING_LENGTH 12
  26. #define GUID_STRING_LENGTH 4 * (DWORD_STRING_LENGTH + 1)
  27. //OID flags/types definition
  28. #define CERT_OID_SETTABLE_FLAGS 0xFFFF0000
  29. #define CERT_OID_MD5_HASH_SIZE 16
  30. //the lenght of oid component that is part of the CN
  31. #define CERT_OID_IDENTITY_LENGTH 16
  32. #define UPPER_BITS 0xF0
  33. #define LOWER_BITS 0x0F
  34. #define OID_RANDOM_CREATION_TRIAL 50
  35. //the number of attribute for the enterprise OID class
  36. #define OID_ATTR_COUNT 6
  37. //we reserver the 1.1-1.500 as the default OIDs for certifcate types
  38. #define OID_RESERVE_DEFAULT_ONE 1
  39. #define OID_RESERVR_DEFAULT_TWO 500
  40. //---------------------------------------------------------------------------
  41. //
  42. // Data type defines
  43. //
  44. //---------------------------------------------------------------------------
  45. #define OID_ATTR_OID 0x01
  46. #define OID_ATTR_TYPE 0x02
  47. #define OID_ATTR_DISPLAY_NAME 0x04
  48. #define OID_ATTR_CPS 0x08
  49. #define OID_ATTR_ALL (OID_ATTR_OID | OID_ATTR_TYPE | OID_ATTR_DISPLAY_NAME | OID_ATTR_CPS)
  50. typedef struct _ENT_OID_INFO
  51. {
  52. DWORD dwAttr;
  53. LPWSTR pwszOID;
  54. DWORD dwType;
  55. LPWSTR pwszDisplayName;
  56. LPWSTR pwszCPS;
  57. }ENT_OID_INFO;
  58. extern LPWSTR g_pwszEnterpriseRootOID;
  59. //---------------------------------------------------------------------------
  60. //
  61. // Function Prototypes
  62. //
  63. //---------------------------------------------------------------------------
  64. HRESULT I_CAOIDCreateNew(DWORD dwType, DWORD dwFlag, LPWSTR *ppwszOID);
  65. HRESULT CAOIDRetrieveEnterpriseRoot(DWORD dwFlag, LPWSTR *ppwszOID);
  66. HRESULT CAOIDBuildOID(DWORD dwFlag, LPCWSTR pwszEndOID, LPWSTR *ppwszOID);
  67. HRESULT I_CAOIDSetProperty(LPCWSTR pwszOID, DWORD dwProperty, LPVOID pPropValue);
  68. HRESULT I_CAOIDAdd(DWORD dwType, DWORD dwFlag, LPCWSTR pwszOID);
  69. HRESULT
  70. I_CAOIDGetProperty(
  71. IN LPCWSTR pwszOID,
  72. IN DWORD dwProperty,
  73. OUT LPVOID pPropValue);
  74. HRESULT
  75. I_CAOIDFreeProperty(
  76. IN LPVOID pPropValue);
  77. #endif //__OIDMGR_H__