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.

103 lines
3.4 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: frmtcom.h
  8. //
  9. //--------------------------------------------------------------------------
  10. /////////////////////////////////////////////////////////////////
  11. //
  12. // The common format file for both WIN32API and
  13. // activeX FormatCert control
  14. //
  15. //
  16. // Created: Xiaohs
  17. // March-12-97
  18. //
  19. //
  20. //////////////////////////////////////////////////////////////////
  21. #ifndef __COMMON_FORMAT_H__
  22. #define __COMMON_FORMAT_H__
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. //constants for dwFormatStrType
  27. //The default behavior of CryptFormatObject is to return single line
  28. //display. If there is no formatting routine installed for registered
  29. //for the OID, the hex dump will be returned. User can set the flag
  30. //CRYPT_FORMAT_STR_NO_HEX to disable the hex dump. If user prefers
  31. //a multiple link display, set the flag CRYPT_FORMAT_STR_MULTI_LINE
  32. #define CRYPT_FORMAT_STR_MULTI_LINE 0x0001
  33. #define CRYPT_FORMAT_STR_NO_HEX 0x0010
  34. //--------------------------------------------------------------------
  35. // Following are possible values for dwFormatType for formatting X509_NAME
  36. // or X509_UNICODE_NAME
  37. //--------------------------------------------------------------------
  38. //Just get the simple string
  39. #define CRYPT_FORMAT_SIMPLE 0x0001
  40. //Put an attribute name infront of the attribute
  41. //such as "O=Microsoft,DN=xiaohs"
  42. #define CRYPT_FORMAT_X509 0x0002
  43. //Put an OID infront of the simple string, such as
  44. //"2.5.4.22=Microsoft,2.5.4.3=xiaohs"
  45. #define CRYPT_FORMAT_OID 0x0004
  46. //Put a ";" between each RDN. The default is ","
  47. #define CRYPT_FORMAT_RDN_SEMICOLON 0x0100
  48. //Put a "\n" between each RDN.
  49. #define CRYPT_FORMAT_RDN_CRLF 0x0200
  50. //Unquote the DN value, which is quoated by default va the following
  51. //rules: if the DN contains leading or trailing
  52. //white space or one of the following characters: ",", "+", "=",
  53. //""", "\n", "<", ">", "#" or ";". The quoting character is ".
  54. //If the DN Value contains a " it is double quoted ("").
  55. #define CRYPT_FORMAT_RDN_UNQUOTE 0x0400
  56. //reverse the order of the RDNs before converting to the string
  57. #define CRYPT_FORMAT_RDN_REVERSE 0x0800
  58. ///-------------------------------------------------------------------------
  59. // Following are possible values for dwFormatType for formatting a DN.:
  60. //
  61. // The following three values are defined in the section above:
  62. // CRYPT_FORMAT_SIMPLE: Just a simple string
  63. // such as "Microsoft+xiaohs+NT"
  64. // CRYPT_FORMAT_X509 Put an attribute name infront of the attribute
  65. // such as "O=Microsoft+xiaohs+NT"
  66. //
  67. // CRYPT_FORMAT_OID Put an OID infront of the simple string,
  68. // such as "2.5.4.22=Microsoft+xiaohs+NT"
  69. //
  70. // Additional values are defined as following:
  71. //----------------------------------------------------------------------------
  72. //Put a "," between each value. Default is "+"
  73. #define CRYPT_FORMAT_COMMA 0x1000
  74. //Put a ";" between each value
  75. #define CRYPT_FORMAT_SEMICOLON CRYPT_FORMAT_RDN_SEMICOLON
  76. //Put a "\n" between each value
  77. #define CRYPT_FORMAT_CRLF CRYPT_FORMAT_RDN_CRLF
  78. #ifdef __cplusplus
  79. } // Balance extern "C" above
  80. #endif
  81. #endif //__COMMON_FORMAT_H__