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.

700 lines
26 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996 - 1999
  5. //
  6. // File: csprop.h
  7. //
  8. // Contents: Cert Server Property interfaces
  9. //
  10. // History: 31-Jul-96 vich created
  11. //
  12. //---------------------------------------------------------------------------
  13. #ifndef __CSPROP_H__
  14. #define __CSPROP_H__
  15. #include "certdb.h"
  16. // begin_certsrv
  17. //+--------------------------------------------------------------------------
  18. // Name properties:
  19. #define wszPROPDISTINGUISHEDNAME TEXT("DistinguishedName")
  20. #define wszPROPRAWNAME TEXT("RawName")
  21. #define wszPROPCOUNTRY TEXT("Country")
  22. #define wszPROPORGANIZATION TEXT("Organization")
  23. #define wszPROPORGUNIT TEXT("OrgUnit")
  24. #define wszPROPCOMMONNAME TEXT("CommonName")
  25. #define wszPROPLOCALITY TEXT("Locality")
  26. #define wszPROPSTATE TEXT("State")
  27. #define wszPROPTITLE TEXT("Title")
  28. #define wszPROPGIVENNAME TEXT("GivenName")
  29. #define wszPROPINITIALS TEXT("Initials")
  30. #define wszPROPSURNAME TEXT("SurName")
  31. #define wszPROPDOMAINCOMPONENT TEXT("DomainComponent")
  32. #define wszPROPEMAIL TEXT("EMail")
  33. #define wszPROPSTREETADDRESS TEXT("StreetAddress")
  34. #define wszPROPUNSTRUCTUREDNAME TEXT("UnstructuredName")
  35. #define wszPROPUNSTRUCTUREDADDRESS TEXT("UnstructuredAddress")
  36. #define wszPROPDEVICESERIALNUMBER TEXT("DeviceSerialNumber")
  37. //+--------------------------------------------------------------------------
  38. // Subject Name properties:
  39. #define wszPROPSUBJECTDOT TEXT("Subject.")
  40. #define wszPROPSUBJECTDISTINGUISHEDNAME \
  41. wszPROPSUBJECTDOT wszPROPDISTINGUISHEDNAME
  42. #define wszPROPSUBJECTRAWNAME wszPROPSUBJECTDOT wszPROPRAWNAME
  43. #define wszPROPSUBJECTCOUNTRY wszPROPSUBJECTDOT wszPROPCOUNTRY
  44. #define wszPROPSUBJECTORGANIZATION wszPROPSUBJECTDOT wszPROPORGANIZATION
  45. #define wszPROPSUBJECTORGUNIT wszPROPSUBJECTDOT wszPROPORGUNIT
  46. #define wszPROPSUBJECTCOMMONNAME wszPROPSUBJECTDOT wszPROPCOMMONNAME
  47. #define wszPROPSUBJECTLOCALITY wszPROPSUBJECTDOT wszPROPLOCALITY
  48. #define wszPROPSUBJECTSTATE wszPROPSUBJECTDOT wszPROPSTATE
  49. #define wszPROPSUBJECTTITLE wszPROPSUBJECTDOT wszPROPTITLE
  50. #define wszPROPSUBJECTGIVENNAME wszPROPSUBJECTDOT wszPROPGIVENNAME
  51. #define wszPROPSUBJECTINITIALS wszPROPSUBJECTDOT wszPROPINITIALS
  52. #define wszPROPSUBJECTSURNAME wszPROPSUBJECTDOT wszPROPSURNAME
  53. #define wszPROPSUBJECTDOMAINCOMPONENT wszPROPSUBJECTDOT wszPROPDOMAINCOMPONENT
  54. #define wszPROPSUBJECTEMAIL wszPROPSUBJECTDOT wszPROPEMAIL
  55. #define wszPROPSUBJECTSTREETADDRESS wszPROPSUBJECTDOT wszPROPSTREETADDRESS
  56. #define wszPROPSUBJECTUNSTRUCTUREDNAME wszPROPSUBJECTDOT wszPROPUNSTRUCTUREDNAME
  57. #define wszPROPSUBJECTUNSTRUCTUREDADDRESS wszPROPSUBJECTDOT wszPROPUNSTRUCTUREDADDRESS
  58. #define wszPROPSUBJECTDEVICESERIALNUMBER wszPROPSUBJECTDOT wszPROPDEVICESERIALNUMBER
  59. // end_certsrv
  60. //+--------------------------------------------------------------------------
  61. // Issuer Name properties:
  62. #define wszPROPISSUERDOT TEXT("Issuer.")
  63. #define wszPROPISSUERDISTINGUISHEDNAME \
  64. wszPROPISSUERDOT wszPROPDISTINGUISHEDNAME
  65. #define wszPROPISSUERRAWNAME wszPROPISSUERDOT wszPROPRAWNAME
  66. #define wszPROPISSUERCOUNTRY wszPROPISSUERDOT wszPROPCOUNTRY
  67. #define wszPROPISSUERORGANIZATION wszPROPISSUERDOT wszPROPORGANIZATION
  68. #define wszPROPISSUERORGUNIT wszPROPISSUERDOT wszPROPORGUNIT
  69. #define wszPROPISSUERCOMMONNAME wszPROPISSUERDOT wszPROPCOMMONNAME
  70. #define wszPROPISSUERLOCALITY wszPROPISSUERDOT wszPROPLOCALITY
  71. #define wszPROPISSUERSTATE wszPROPISSUERDOT wszPROPSTATE
  72. #define wszPROPISSUERTITLE wszPROPISSUERDOT wszPROPTITLE
  73. #define wszPROPISSUERGIVENNAME wszPROPISSUERDOT wszPROPGIVENNAME
  74. #define wszPROPISSUERINITIALS wszPROPISSUERDOT wszPROPINITIALS
  75. #define wszPROPISSUERSURNAME wszPROPISSUERDOT wszPROPSURNAME
  76. #define wszPROPISSUERDOMAINCOMPONENT wszPROPISSUERDOT wszPROPDOMAINCOMPONENT
  77. #define wszPROPISSUEREMAIL wszPROPISSUERDOT wszPROPEMAIL
  78. #define wszPROPISSUERSTREETADDRESS wszPROPISSUERDOT wszPROPSTREETADDRESS
  79. #define wszPROPISSUERUNSTRUCTUREDNAME wszPROPISSUERDOT wszPROPUNSTRUCTUREDNAME
  80. #define wszPROPISSUERUNSTRUCTUREDADDRESS wszPROPISSUERDOT wszPROPUNSTRUCTUREDADDRESS
  81. #define wszPROPISSUERDEVICESERIALNUMBER wszPROPISSUERDOT wszPROPDEVICESERIALNUMBER
  82. #define wszPROPISSUERCOUNTRYOBJID \
  83. wszPROPISSUERDOT TEXT(szOID_COUNTRY_NAME)
  84. #define wszPROPISSUERORGANIZATIONOBJID \
  85. wszPROPISSUERDOT TEXT(szOID_ORGANIZATION_NAME)
  86. #define wszPROPISSUERORGUNITOBJID \
  87. wszPROPISSUERDOT TEXT(szOID_ORGANIZATIONAL_UNIT_NAME)
  88. #define wszPROPISSUERCOMMONNAMEOBJID \
  89. wszPROPISSUERDOT TEXT(szOID_COMMON_NAME)
  90. #define wszPROPISSUERLOCALITYOBJID \
  91. wszPROPISSUERDOT TEXT(szOID_LOCALITY_NAME)
  92. #define wszPROPISSUERSTATEOBJID \
  93. wszPROPISSUERDOT TEXT(szOID_STATE_OR_PROVINCE_NAME)
  94. #define wszPROPISSUERTITLEOBJID \
  95. wszPROPISSUERDOT TEXT(szOID_TITLE)
  96. #define wszPROPISSUERGIVENNAMEOBJID \
  97. wszPROPISSUERDOT TEXT(szOID_GIVEN_NAME)
  98. #define wszPROPISSUERINITIALSOBJID \
  99. wszPROPISSUERDOT TEXT(szOID_INITIALS)
  100. #define wszPROPISSUERSURNAMEOBJID \
  101. wszPROPISSUERDOT TEXT(szOID_SUR_NAME)
  102. #define wszPROPISSUERDOMAINCOMPONENTOBJID \
  103. wszPROPISSUERDOT TEXT(szOID_DOMAIN_COMPONENT)
  104. #define wszPROPISSUEREMAILOBJID \
  105. wszPROPISSUERDOT TEXT(szOID_RSA_emailAddr)
  106. #define wszPROPISSUERSTREETADDRESSOBJID \
  107. wszPROPISSUERDOT TEXT(szOID_STREET_ADDRESS)
  108. #define wszPROPISSUERUNSTRUCTUREDNAMEOBJID \
  109. wszPROPISSUERDOT TEXT(szOID_RSA_unstructName)
  110. #define wszPROPISSUERUNSTRUCTUREDADDRESSOBJID \
  111. wszPROPISSUERDOT TEXT(szOID_RSA_unstructAddr)
  112. #define wszPROPISSUERDEVICESERIALNUMBEROBJID \
  113. wszPROPISSUERDOT TEXT(szOID_DEVICE_SERIAL_NUMBER)
  114. //+--------------------------------------------------------------------------
  115. // For mapping request attribute names to internal property names:
  116. // Map to wszPROPSUBJECTCOUNTRY:
  117. #define wszATTRCOUNTRY1 TEXT("C")
  118. #define wszATTRCOUNTRY2 TEXT("Country")
  119. // Map to wszPROPSUBJECTORGANIZATION:
  120. #define wszATTRORG1 TEXT("O")
  121. #define wszATTRORG2 TEXT("Org")
  122. #define wszATTRORG3 TEXT("Organization")
  123. // Map to wszPROPSUBJECTORGUNIT:
  124. #define wszATTRORGUNIT1 TEXT("OU")
  125. #define wszATTRORGUNIT2 TEXT("OrgUnit")
  126. #define wszATTRORGUNIT3 TEXT("OrganizationUnit")
  127. #define wszATTRORGUNIT4 TEXT("OrganizationalUnit")
  128. // Map to wszPROPSUBJECTCOMMONNAME:
  129. #define wszATTRCOMMONNAME1 TEXT("CN")
  130. #define wszATTRCOMMONNAME2 TEXT("CommonName")
  131. // Map to wszPROPSUBJECTLOCALITY:
  132. #define wszATTRLOCALITY1 TEXT("L")
  133. #define wszATTRLOCALITY2 TEXT("Locality")
  134. // Map to wszPROPSUBJECTSTATE:
  135. #define wszATTRSTATE1 TEXT("S")
  136. #define wszATTRSTATE2 TEXT("ST")
  137. #define wszATTRSTATE3 TEXT("State")
  138. // Map to wszPROPSUBJECTTITLE:
  139. #define wszATTRTITLE1 TEXT("T")
  140. #define wszATTRTITLE2 TEXT("Title")
  141. // Map to wszPROPSUBJECTGIVENNAME:
  142. #define wszATTRGIVENNAME1 TEXT("G")
  143. #define wszATTRGIVENNAME2 TEXT("GivenName")
  144. // Map to wszPROPSUBJECTINITIALS:
  145. #define wszATTRINITIALS1 TEXT("I")
  146. #define wszATTRINITIALS2 TEXT("Initials")
  147. // Map to wszPROPSUBJECTSURNAME:
  148. #define wszATTRSURNAME1 TEXT("SN")
  149. #define wszATTRSURNAME2 TEXT("SurName")
  150. // Map to wszPROPSUBJECTDOMAINCOMPONENT:
  151. #define wszATTRDOMAINCOMPONENT1 TEXT("DC")
  152. #define wszATTRDOMAINCOMPONENT2 TEXT("DomainComponent")
  153. // Map to wszPROPSUBJECTEMAIL:
  154. #define wszATTREMAIL1 TEXT("E")
  155. #define wszATTREMAIL2 TEXT("EMail")
  156. // Map to wszPROPSUBJECTSTREETADDRESS:
  157. #define wszATTRSTREETADDRESS1 TEXT("Street")
  158. #define wszATTRSTREETADDRESS2 TEXT("StreetAddress")
  159. // Map to wszPROPSUBJECTUNSTRUCTUREDNAME:
  160. #define wszATTRUNSTRUCTUREDNAME1 TEXT("UnstructuredName")
  161. // Map to wszPROPSUBJECTUNSTRUCTUREDADDRESS:
  162. #define wszATTRUNSTRUCTUREDADDRESS1 TEXT("UnstructuredAddress")
  163. // Map to wszPROPSUBJECTDEVICESERIALNUMBER:
  164. #define wszATTRDEVICESERIALNUMBER1 TEXT("DeviceSerialNumber")
  165. #define wszPROPCERTCLIDLL_VERSION TEXT("..CertCli Version")
  166. // begin_certsrv
  167. //+--------------------------------------------------------------------------
  168. // Request properties:
  169. #define wszPROPREQUESTDOT TEXT("Request.")
  170. #define wszPROPREQUESTREQUESTID TEXT("RequestID")
  171. #define wszPROPREQUESTRAWREQUEST TEXT("RawRequest")
  172. #define wszPROPREQUESTRAWARCHIVEDKEY TEXT("RawArchivedKey")
  173. #define wszPROPREQUESTKEYRECOVERYHASHES TEXT("KeyRecoveryHashes")
  174. #define wszPROPREQUESTRAWOLDCERTIFICATE TEXT("RawOldCertificate")
  175. #define wszPROPREQUESTATTRIBUTES TEXT("RequestAttributes")
  176. #define wszPROPREQUESTTYPE TEXT("RequestType")
  177. #define wszPROPREQUESTFLAGS TEXT("RequestFlags")
  178. #define wszPROPREQUESTSTATUSCODE TEXT("StatusCode")
  179. #define wszPROPREQUESTDISPOSITION TEXT("Disposition")
  180. #define wszPROPREQUESTDISPOSITIONMESSAGE TEXT("DispositionMessage")
  181. #define wszPROPREQUESTSUBMITTEDWHEN TEXT("SubmittedWhen")
  182. #define wszPROPREQUESTRESOLVEDWHEN TEXT("ResolvedWhen")
  183. #define wszPROPREQUESTREVOKEDWHEN TEXT("RevokedWhen")
  184. #define wszPROPREQUESTREVOKEDEFFECTIVEWHEN TEXT("RevokedEffectiveWhen")
  185. #define wszPROPREQUESTREVOKEDREASON TEXT("RevokedReason")
  186. #define wszPROPREQUESTERNAME TEXT("RequesterName")
  187. #define wszPROPCALLERNAME TEXT("CallerName")
  188. #define wszPROPREQUESTERADDRESS TEXT("RequesterAddress") // no_certsrv
  189. #define wszPROPSIGNERPOLICIES TEXT("SignerPolicies")
  190. #define wszPROPSIGNERAPPLICATIONPOLICIES TEXT("SignerApplicationPolicies")
  191. #define wszPROPOFFICER TEXT("Officer")
  192. //+--------------------------------------------------------------------------
  193. // Request attribute properties:
  194. #define wszPROPCHALLENGE TEXT("Challenge")
  195. #define wszPROPEXPECTEDCHALLENGE TEXT("ExpectedChallenge")
  196. #define wszPROPDISPOSITION TEXT("Disposition")
  197. #define wszPROPDISPOSITIONDENY TEXT("Deny")
  198. #define wszPROPDISPOSITIONPENDING TEXT("Pending")
  199. #define wszPROPVALIDITYPERIODSTRING TEXT("ValidityPeriod")
  200. #define wszPROPVALIDITYPERIODCOUNT TEXT("ValidityPeriodUnits")
  201. #define wszPROPCERTTYPE TEXT("CertType")
  202. #define wszPROPCERTTEMPLATE TEXT("CertificateTemplate")
  203. #define wszPROPCERTUSAGE TEXT("CertificateUsage")
  204. #define wszPROPREQUESTOSVERSION TEXT("RequestOSVersion")
  205. #define wszPROPREQUESTCSPPROVIDER TEXT("RequestCSPProvider")
  206. #define wszPROPEXITCERTFILE TEXT("CertFile")
  207. #define wszPROPCLIENTBROWSERMACHINE TEXT("cbm")
  208. #define wszPROPCERTCLIENTMACHINE TEXT("ccm")
  209. #define wszPROPCLIENTDCDNS L"cdc"
  210. #define wszPROPREQUESTMACHINEDNS L"rmd"
  211. #define wszPROPSUBJECTALTNAME2 TEXT("san")
  212. #define wszPROPDNS TEXT("dns")
  213. #define wszPROPDN TEXT("dn")
  214. #define wszPROPURL TEXT("url")
  215. #define wszPROPIPADDRESS TEXT("ipaddress")
  216. #define wszPROPGUID TEXT("guid")
  217. #define wszPROPOID TEXT("oid")
  218. #define wszPROPUPN TEXT("upn")
  219. #define wszPROPUPN TEXT("upn")
  220. #define szPROPASNTAG "{asn}"
  221. #define wszPROPUTF8TAG TEXT("{utf8}")
  222. #define wszPROPOCTETTAG TEXT("{octet}")
  223. #define wszPROPASNTAG TEXT(szPROPASNTAG)
  224. //+--------------------------------------------------------------------------
  225. // "System" properties
  226. // ".#" means ".0", ".1", ".2" ... may be appended to the property name to
  227. // collect context specific values. For some properties, the suffix selects
  228. // the CA certificate context. For others, it selects the the CA CRL context.
  229. #define wszPROPCATYPE TEXT("CAType")
  230. #define wszPROPSANITIZEDCANAME TEXT("SanitizedCAName")
  231. #define wszPROPSANITIZEDSHORTNAME TEXT("SanitizedShortName")
  232. #define wszPROPMACHINEDNSNAME TEXT("MachineDNSName")
  233. #define wszPROPMODULEREGLOC TEXT("ModuleRegistryLocation")
  234. #define wszPROPUSEDS TEXT("fUseDS")
  235. #define wszPROPDELTACRLSDISABLED TEXT("fDeltaCRLsDisabled")
  236. #define wszPROPSERVERUPGRADED TEXT("fServerUpgraded")
  237. #define wszPROPCONFIGDN TEXT("ConfigDN")
  238. #define wszPROPDOMAINDN TEXT("DomainDN")
  239. #define wszPROPLOGLEVEL TEXT("LogLevel")
  240. #define wszPROPSESSIONCOUNT TEXT("SessionCount")
  241. #define wszPROPTEMPLATECHANGESEQUENCENUMBER TEXT("TemplateChangeSequenceNumber")
  242. // Request Context properties:
  243. #define wszPROPREQUESTERTOKEN TEXT("RequesterToken") // no_certsrv
  244. #define wszPROPREQUESTERCAACCESS TEXT("RequesterCAAccess")
  245. #define wszPROPUSERDN TEXT("UserDN")
  246. #define wszPROPKEYARCHIVED TEXT("KeyArchived")
  247. // CA Certificate properties: (all ".#" extensible except wszPROPCERTCOUNT)
  248. #define wszPROPCERTCOUNT TEXT("CertCount")
  249. #define wszPROPRAWCACERTIFICATE TEXT("RawCACertificate")
  250. #define wszPROPCERTSTATE TEXT("CertState")
  251. #define wszPROPCERTSUFFIX TEXT("CertSuffix")
  252. // CA CRL properties: (all ".#" extensible)
  253. #define wszPROPRAWCRL TEXT("RawCRL")
  254. #define wszPROPRAWDELTACRL TEXT("RawDeltaCRL")
  255. #define wszPROPCRLINDEX TEXT("CRLIndex")
  256. #define wszPROPCRLSTATE TEXT("CRLState")
  257. #define wszPROPCRLSUFFIX TEXT("CRLSuffix")
  258. // Values for wszPROPCERTSTATE (see certadm.h):
  259. // CA_DISP_REVOKED // This Cert has been revoked.
  260. // CA_DISP_VALID // This Cert is still valid
  261. // CA_DISP_INVALID // This Cert has expired.
  262. // CA_DISP_ERROR // Cert unavailable (placehholder in registry?)
  263. // Values for wszPROPCRLSTATE (see certadm.h):
  264. // CA_DISP_REVOKED // All unexpired certs using this Cert's CRL have been
  265. // // revoked.
  266. // CA_DISP_VALID // This Cert is still publishing CRLs as needed.
  267. // CA_DISP_INVALID // All certs using this Cert's CRL are expired.
  268. // CA_DISP_ERROR // This Cert's CRL is managed by another Cert.
  269. // "Settable" system properties:
  270. #define wszPROPEVENTLOGTERSE TEXT("EventLogTerse")
  271. #define wszPROPEVENTLOGERROR TEXT("EventLogError")
  272. #define wszPROPEVENTLOGWARNING TEXT("EventLogWarning")
  273. #define wszPROPEVENTLOGVERBOSE TEXT("EventLogVerbose")
  274. #define wszPROPEVENTLOGEXHAUSTIVE TEXT("EventLogExhaustive")
  275. #define wszPROPDCNAME TEXT("DCName")
  276. //+--------------------------------------------------------------------------
  277. // Certificate properties:
  278. #define wszPROPCERTIFICATEREQUESTID TEXT("RequestID")
  279. #define wszPROPRAWCERTIFICATE TEXT("RawCertificate")
  280. #define wszPROPCERTIFICATEHASH TEXT("CertificateHash")
  281. #define wszPROPCERTIFICATETEMPLATE TEXT("CertificateTemplate")
  282. #define wszPROPCERTIFICATEENROLLMENTFLAGS TEXT("EnrollmentFlags")
  283. #define wszPROPCERTIFICATEGENERALFLAGS TEXT("GeneralFlags")
  284. #define wszPROPCERTIFICATESERIALNUMBER TEXT("SerialNumber")
  285. #define wszPROPCERTIFICATEISSUERNAMEID TEXT("IssuerNameID")//no_certsrv
  286. #define wszPROPCERTIFICATENOTBEFOREDATE TEXT("NotBefore")
  287. #define wszPROPCERTIFICATENOTAFTERDATE TEXT("NotAfter")
  288. #define wszPROPCERTIFICATESUBJECTKEYIDENTIFIER TEXT("SubjectKeyIdentifier")
  289. #define wszPROPCERTIFICATERAWPUBLICKEY TEXT("RawPublicKey")
  290. #define wszPROPCERTIFICATEPUBLICKEYLENGTH TEXT("PublicKeyLength")
  291. #define wszPROPCERTIFICATEPUBLICKEYALGORITHM TEXT("PublicKeyAlgorithm")
  292. #define wszPROPCERTIFICATERAWPUBLICKEYALGORITHMPARAMETERS \
  293. TEXT("RawPublicKeyAlgorithmParameters")
  294. #define wszPROPCERTIFICATEUPN TEXT("UPN")
  295. // Obsolete:
  296. #define wszPROPCERTIFICATETYPE TEXT("CertificateType")
  297. #define wszPROPCERTIFICATERAWSMIMECAPABILITIES TEXT("RawSMIMECapabilities")
  298. #define wszPROPNAMETYPE TEXT("NameType")
  299. //+--------------------------------------------------------------------------
  300. // Certificate extension properties:
  301. #define EXTENSION_CRITICAL_FLAG 0x00000001
  302. #define EXTENSION_DISABLE_FLAG 0x00000002
  303. #define EXTENSION_POLICY_MASK 0x0000ffff // Settable by admin+policy
  304. #define EXTENSION_ORIGIN_REQUEST 0x00010000
  305. #define EXTENSION_ORIGIN_POLICY 0x00020000
  306. #define EXTENSION_ORIGIN_ADMIN 0x00030000
  307. #define EXTENSION_ORIGIN_SERVER 0x00040000
  308. #define EXTENSION_ORIGIN_RENEWALCERT 0x00050000
  309. #define EXTENSION_ORIGIN_IMPORTEDCERT 0x00060000
  310. #define EXTENSION_ORIGIN_PKCS7 0x00070000
  311. #define EXTENSION_ORIGIN_CMC 0x00080000
  312. #define EXTENSION_ORIGIN_CACERT 0x00090000
  313. #define EXTENSION_ORIGIN_MASK 0x000f0000
  314. //+--------------------------------------------------------------------------
  315. // Extension properties:
  316. #define wszPROPEXTREQUESTID TEXT("ExtensionRequestId")
  317. #define wszPROPEXTNAME TEXT("ExtensionName")
  318. #define wszPROPEXTFLAGS TEXT("ExtensionFlags")
  319. #define wszPROPEXTRAWVALUE TEXT("ExtensionRawValue")
  320. //+--------------------------------------------------------------------------
  321. // Attribute properties:
  322. #define wszPROPATTRIBREQUESTID TEXT("AttributeRequestId")
  323. #define wszPROPATTRIBNAME TEXT("AttributeName")
  324. #define wszPROPATTRIBVALUE TEXT("AttributeValue")
  325. //+--------------------------------------------------------------------------
  326. // CRL properties:
  327. #define wszPROPCRLROWID TEXT("CRLRowId")
  328. #define wszPROPCRLNUMBER TEXT("CRLNumber")
  329. #define wszPROPCRLMINBASE TEXT("CRLMinBase") // Delta CRLs only
  330. #define wszPROPCRLNAMEID TEXT("CRLNameId")
  331. #define wszPROPCRLCOUNT TEXT("CRLCount")
  332. #define wszPROPCRLTHISUPDATE TEXT("CRLThisUpdate")
  333. #define wszPROPCRLNEXTUPDATE TEXT("CRLNextUpdate")
  334. #define wszPROPCRLTHISPUBLISH TEXT("CRLThisPublish")
  335. #define wszPROPCRLNEXTPUBLISH TEXT("CRLNextPublish")
  336. #define wszPROPCRLEFFECTIVE TEXT("CRLEffective")
  337. #define wszPROPCRLPROPAGATIONCOMPLETE TEXT("CRLPropagationComplete")
  338. #define wszPROPCRLLASTPUBLISHED TEXT("CRLLastPublished")
  339. #define wszPROPCRLPUBLISHATTEMPTS TEXT("CRLPublishAttempts")
  340. #define wszPROPCRLPUBLISHFLAGS TEXT("CRLPublishFlags")
  341. #define wszPROPCRLPUBLISHSTATUSCODE TEXT("CRLPublishStatusCode")
  342. #define wszPROPCRLPUBLISHERROR TEXT("CRLPublishError")
  343. #define wszPROPCRLRAWCRL TEXT("CRLRawCRL")
  344. //+--------------------------------------------------------------------------
  345. // CRL Published Flags:
  346. #define CPF_BASE 0x00000001
  347. #define CPF_DELTA 0x00000002
  348. #define CPF_COMPLETE 0x00000004
  349. #define CPF_SHADOW 0x00000008
  350. #define CPF_CASTORE_ERROR 0x00000010
  351. #define CPF_BADURL_ERROR 0x00000020
  352. #define CPF_MANUAL 0x00000040
  353. #define CPF_SIGNATURE_ERROR 0x00000080
  354. #define CPF_LDAP_ERROR 0x00000100
  355. #define CPF_FILE_ERROR 0x00000200
  356. #define CPF_FTP_ERROR 0x00000400
  357. #define CPF_HTTP_ERROR 0x00000800
  358. //+--------------------------------------------------------------------------
  359. // GetProperty/SetProperty Flags:
  360. //
  361. // Choose one Type
  362. #define PROPTYPE_LONG 0x00000001 // Signed long
  363. #define PROPTYPE_DATE 0x00000002 // Date+Time
  364. #define PROPTYPE_BINARY 0x00000003 // Binary data
  365. #define PROPTYPE_STRING 0x00000004 // Unicode String
  366. #define PROPTYPE_MASK 0x000000ff
  367. // Choose one Caller:
  368. #define PROPCALLER_SERVER 0x00000100
  369. #define PROPCALLER_POLICY 0x00000200
  370. #define PROPCALLER_EXIT 0x00000300
  371. #define PROPCALLER_ADMIN 0x00000400
  372. #define PROPCALLER_REQUEST 0x00000500
  373. #define PROPCALLER_MASK 0x00000f00
  374. // end_certsrv
  375. // Choose one Table:
  376. #define PROPTABLE_REQCERT 0x00000000 // OpenRow only
  377. #define PROPTABLE_REQUEST 0x00001000
  378. #define PROPTABLE_CERTIFICATE 0x00002000
  379. #define PROPTABLE_EXTENSION 0x00003000
  380. #define PROPTABLE_ATTRIBUTE 0x00004000
  381. #define PROPTABLE_CRL 0x00005000
  382. #define PROPTABLE_MASK 0x0000f000
  383. #define PROPFLAGS_INDEXED 0x00010000 // add_certsrv
  384. #define PROPFLAGS_MASK 0x000f0000
  385. #define PROPMARSHAL_LOCALSTRING 0x00100000
  386. #define PROPMARSHAL_NULLBSTROK 0x00200000
  387. #define PROPOPEN_READONLY 0x00400000 // OpenRow only
  388. #define PROPOPEN_DELETE 0x00800000 // OpenRow only
  389. #define PROPOPEN_CERTHASH 0x01000000 // OpenRow only
  390. // begin_certsrv
  391. // RequestFlags definitions:
  392. #define CR_FLG_FORCETELETEX 0x00000001
  393. #define CR_FLG_RENEWAL 0x00000002
  394. #define CR_FLG_FORCEUTF8 0x00000004
  395. #define CR_FLG_CAXCHGCERT 0x00000008
  396. #define CR_FLG_ENROLLONBEHALFOF 0x00000010
  397. #define CR_FLG_SUBJECTUNMODIFIED 0x00000020
  398. #define CR_FLG_VALIDENCRYPTEDKEYHASH 0x00000040
  399. #define CR_FLG_CACROSSCERT 0x00000080
  400. #define CR_FLG_PUBLISHERROR 0x80000000
  401. // end_certsrv
  402. #define CB_DBMAXBINARY (4 * 1024)
  403. #define CB_DBMAXRAWCERTIFICATE (16 * 1024)
  404. #define CB_DBMAXRAWREQUEST (64 * 1024)
  405. #define CB_DBMAXRAWCRL (512 * 1024 * 1024) // 512mb
  406. #define CCH_DBMAXTEXT_MAXINTERNAL (255 / sizeof(WCHAR)) // 127 chars!
  407. #define CB_DBMAXTEXT_MAXINTERNAL (CCH_DBMAXTEXT_MAXINTERNAL * sizeof(WCHAR))
  408. #define CCH_DBMAXTEXT_SHORT 1024
  409. #define CB_DBMAXTEXT_SHORT (CCH_DBMAXTEXT_SHORT * sizeof(WCHAR))
  410. #define CCH_DBMAXTEXT_MEDIUM (4 * 1024)
  411. #define CB_DBMAXTEXT_MEDIUM (CCH_DBMAXTEXT_MEDIUM * sizeof(WCHAR))
  412. #define CCH_DBMAXTEXT_LONG (16 * 1024)
  413. #define CB_DBMAXTEXT_LONG (CCH_DBMAXTEXT_LONG * sizeof(WCHAR))
  414. #define CCH_DBMAXTEXT_OID CCH_DBMAXTEXT_MAXINTERNAL
  415. #define CB_DBMAXTEXT_OID CB_DBMAXTEXT_MAXINTERNAL
  416. #define CCH_DBMAXTEXT_REQUESTNAME CCH_DBMAXTEXT_SHORT
  417. #define CB_DBMAXTEXT_REQUESTNAME CB_DBMAXTEXT_SHORT
  418. #define CCH_DBMAXTEXT_DISPSTRING CCH_DBMAXTEXT_MEDIUM
  419. #define CB_DBMAXTEXT_DISPSTRING CB_DBMAXTEXT_MEDIUM
  420. #define CCH_DBMAXTEXT_RDN CCH_DBMAXTEXT_MEDIUM
  421. #define CB_DBMAXTEXT_RDN CB_DBMAXTEXT_MEDIUM
  422. #define CCH_DBMAXTEXT_DN CCH_DBMAXTEXT_MEDIUM
  423. #define CB_DBMAXTEXT_DN CB_DBMAXTEXT_MEDIUM
  424. #define CCH_DBMAXTEXT_ATTRNAME CCH_DBMAXTEXT_MAXINTERNAL
  425. #define CB_DBMAXTEXT_ATTRNAME CB_DBMAXTEXT_MAXINTERNAL
  426. #define CCH_DBMAXTEXT_ATTRVALUE CCH_DBMAXTEXT_MEDIUM
  427. #define CB_DBMAXTEXT_ATTRVALUE CB_DBMAXTEXT_MEDIUM
  428. #define CCH_DBMAXTEXT_ATTRSTRING CCH_DBMAXTEXT_LONG
  429. #define CB_DBMAXTEXT_ATTRSTRING CB_DBMAXTEXT_LONG
  430. #define cchHASHMAX 64
  431. #define cchSERIALNUMBERMAX 64
  432. #define cchUNSTRUCTUREDNAMEMAX CCH_DBMAXTEXT_SHORT
  433. #define cchUNSTRUCTUREDADDRESSMAX CCH_DBMAXTEXT_SHORT
  434. #define cchDEVICESERIALNUMBERMAX CCH_DBMAXTEXT_SHORT
  435. // Subject RDN string length limits from PKIX Part 1 doc:
  436. #define cchCOUNTRYNAMEMAX 2
  437. #define cchORGANIZATIONNAMEMAX 64
  438. #define cchORGANIZATIONALUNITNAMEMAX 64
  439. #define cchCOMMONNAMEMAX 64
  440. #define cchLOCALITYMANAMEMAX 128
  441. #define cchSTATEORPROVINCENAMEMAX 128
  442. #define cchTITLEMAX 64
  443. #define cchGIVENNAMEMAX 16
  444. #define cchINITIALSMAX 5
  445. #define cchSURNAMEMAX 40
  446. #define cchDOMAINCOMPONENTMAX 128
  447. #define cchEMAILMAX 128
  448. #define cchSTREETADDRESSMAX 30
  449. #ifdef cchCOMMONNAMEMAX_XELIB
  450. # if cchCOMMONNAMEMAX_XELIB != cchCOMMONNAMEMAX
  451. # error cchCOMMONNAMEMAX_XELIB != cchCOMMONNAMEMAX
  452. # endif
  453. #endif
  454. // begin_certsrv
  455. // Disposition property values:
  456. // Disposition values for requests in the queue:
  457. #define DB_DISP_ACTIVE 8 // being processed
  458. #define DB_DISP_PENDING 9 // taken under submission
  459. #define DB_DISP_QUEUE_MAX 9 // max disposition value for queue view
  460. #define DB_DISP_FOREIGN 12 // archived foreign cert
  461. #define DB_DISP_CA_CERT 15 // CA cert
  462. #define DB_DISP_CA_CERT_CHAIN 16 // CA cert chain
  463. #define DB_DISP_KRA_CERT 17 // KRA cert
  464. // Disposition values for requests in the log:
  465. #define DB_DISP_LOG_MIN 20 // min disposition value for log view
  466. #define DB_DISP_ISSUED 20 // cert issued
  467. #define DB_DISP_REVOKED 21 // issued and revoked
  468. // Disposition values for failed requests in the log:
  469. #define DB_DISP_LOG_FAILED_MIN 30 // min disposition value for log view
  470. #define DB_DISP_ERROR 30 // request failed
  471. #define DB_DISP_DENIED 31 // request denied
  472. // end_certsrv
  473. // CertIF property callback support:
  474. typedef HRESULT (WINAPI FNCIGETPROPERTY)(
  475. IN LONG Context,
  476. IN DWORD Flags,
  477. IN WCHAR const *pwszPropertyName,
  478. OUT VARIANT *pvarPropertyValue);
  479. FNCIGETPROPERTY PropCIGetProperty;
  480. typedef HRESULT (WINAPI FNCISETPROPERTY)(
  481. IN LONG Context,
  482. IN DWORD Flags,
  483. IN WCHAR const *pwszPropertyName,
  484. IN VARIANT const *pvarPropertyValue);
  485. FNCISETPROPERTY PropCISetProperty;
  486. typedef HRESULT (WINAPI FNCIGETEXTENSION)(
  487. IN LONG Context,
  488. IN DWORD Flags,
  489. IN WCHAR const *pwszExtensionName,
  490. OUT DWORD *pdwExtFlags,
  491. OUT VARIANT *pvarValue);
  492. FNCIGETEXTENSION PropCIGetExtension;
  493. typedef HRESULT (WINAPI FNCISETEXTENSION)(
  494. IN LONG Context,
  495. IN DWORD Flags,
  496. IN WCHAR const *pwszExtensionName,
  497. IN DWORD ExtFlags,
  498. IN VARIANT const *pvarValue);
  499. FNCISETEXTENSION PropCISetExtension;
  500. // CertIF property enumeration callback support:
  501. #define CIE_OBJECTID 0x00000001 // return object ids for names
  502. #define CIE_RESET 0x00000002
  503. #define CIE_TABLE_EXTENSIONS 0x00000010
  504. #define CIE_TABLE_ATTRIBUTES 0x00000020
  505. #define CIE_TABLE_MASK 0x000000f0
  506. #define CIE_CALLER_POLICY 0x00000200
  507. #define CIE_CALLER_EXIT 0x00000300
  508. #define CIE_CALLER_MASK 0x00000f00
  509. class CIENUM {
  510. public:
  511. CIENUM() { m_penum = NULL; }
  512. HRESULT EnumSetup(IN DWORD RequestId, IN LONG Context, IN DWORD Flags);
  513. HRESULT EnumNext(OUT BSTR *pstrPropertyName);
  514. HRESULT EnumClose();
  515. LONG GetContext() { return(m_Context); }
  516. DWORD GetFlags() { return(m_Flags); }
  517. private:
  518. IEnumCERTDBNAME *m_penum;
  519. LONG m_Context;
  520. DWORD m_Flags;
  521. };
  522. typedef HRESULT (WINAPI FNCIENUMSETUP)(
  523. IN LONG Context,
  524. IN LONG Flags,
  525. IN OUT CIENUM *pciEnum);
  526. FNCIENUMSETUP PropCIEnumSetup;
  527. typedef HRESULT (WINAPI FNCIENUMNEXT)(
  528. IN OUT CIENUM *pciEnum,
  529. OUT BSTR *pstrPropertyName);
  530. FNCIENUMNEXT PropCIEnumNext;
  531. typedef HRESULT (WINAPI FNCIENUMCLOSE)(
  532. IN OUT CIENUM *pciEnum);
  533. FNCIENUMCLOSE PropCIEnumClose;
  534. #endif // __CSPROP_H__