CertCli.Idl 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996 - 1999
  5. //
  6. // File: certcli.idl
  7. //
  8. // Contents: IDL source for certcli.dll
  9. //
  10. //---------------------------------------------------------------------------
  11. // This file will be processed by the MIDL tool to produce the type library
  12. // (certcli.tlb) and marshalling code.
  13. import "wtypes.idl";
  14. import "certif.idl";
  15. import "oaidl.idl";
  16. //+--------------------------------------------------------------------------
  17. // ICertGetConfig -- local COM interface, local implementation
  18. //+--------------------------------------------------------------------------
  19. [
  20. object,
  21. uuid(c7ea09c0-ce17-11d0-8833-00a0c903b83c),
  22. dual,
  23. helpstring("ICertGetConfig Interface"),
  24. pointer_default(unique)
  25. ]
  26. interface ICertGetConfig: IDispatch
  27. {
  28. HRESULT GetConfig(
  29. [in] LONG Flags,
  30. [out, retval] BSTR *pstrOut);
  31. };
  32. //+--------------------------------------------------------------------------
  33. // ICertConfig::GetField()
  34. // strFieldName parameter values:
  35. cpp_quote("#define wszCONFIG_COMMONNAME L\"CommonName\"")
  36. cpp_quote("#define wszCONFIG_ORGUNIT L\"OrgUnit\"")
  37. cpp_quote("#define wszCONFIG_ORGANIZATION L\"Organization\"")
  38. cpp_quote("#define wszCONFIG_LOCALITY L\"Locality\"")
  39. cpp_quote("#define wszCONFIG_STATE L\"State\"")
  40. cpp_quote("#define wszCONFIG_COUNTRY L\"Country\"")
  41. cpp_quote("#define wszCONFIG_CONFIG L\"Config\"")
  42. cpp_quote("#define wszCONFIG_EXCHANGECERTIFICATE L\"ExchangeCertificate\"")
  43. cpp_quote("#define wszCONFIG_SIGNATURECERTIFICATE L\"SignatureCertificate\"")
  44. cpp_quote("#define wszCONFIG_DESCRIPTION L\"Description\"")
  45. cpp_quote("#define wszCONFIG_COMMENT L\"Comment\" // obsolete: use Description")
  46. cpp_quote("#define wszCONFIG_SERVER L\"Server\"")
  47. cpp_quote("#define wszCONFIG_AUTHORITY L\"Authority\"")
  48. cpp_quote("#define wszCONFIG_SANITIZEDNAME L\"SanitizedName\"")
  49. cpp_quote("#define wszCONFIG_SHORTNAME L\"ShortName\"")
  50. cpp_quote("#define wszCONFIG_SANITIZEDSHORTNAME L\"SanitizedShortName\"")
  51. cpp_quote("#define wszCONFIG_FLAGS L\"Flags\"")
  52. // Flags setting
  53. const LONG CAIF_DSENTRY = 0x00000001; // bit set for CA from DS
  54. const LONG CAIF_SHAREDFOLDERENTRY = 0x00000002; // CA from shared folder
  55. const LONG CAIF_REGISTRY = 0x00000004; // CA from local registry
  56. const LONG CAIF_LOCAL = 0x00000008; // local CA
  57. const LONG CAIF_REGISTRYPARENT = 0x00000010; // CA parent from registry
  58. //+--------------------------------------------------------------------------
  59. // ICertConfig -- local COM interface, local implementation
  60. //+--------------------------------------------------------------------------
  61. [
  62. object,
  63. uuid(372fce34-4324-11d0-8810-00a0c903b83c),
  64. dual,
  65. helpstring("ICertConfig Interface"),
  66. pointer_default(unique)
  67. ]
  68. interface ICertConfig: IDispatch
  69. {
  70. HRESULT Reset(
  71. [in] LONG Index,
  72. [out, retval] LONG *pCount);
  73. HRESULT Next(
  74. [out, retval] LONG *pIndex);
  75. HRESULT GetField(
  76. [in] BSTR const strFieldName,
  77. [out, retval] BSTR *pstrOut);
  78. HRESULT GetConfig(
  79. [in] LONG Flags,
  80. [out, retval] BSTR *pstrOut);
  81. };
  82. //+--------------------------------------------------------------------------
  83. // ICertConfig2 -- local COM interface, local implementation
  84. //+--------------------------------------------------------------------------
  85. [
  86. object,
  87. uuid(7a18edde-7e78-4163-8ded-78e2c9cee924),
  88. dual,
  89. helpstring("ICertConfig2 Interface"),
  90. pointer_default(unique)
  91. ]
  92. interface ICertConfig2: ICertConfig
  93. {
  94. HRESULT SetSharedFolder(
  95. [in] BSTR const strSharedFolder);
  96. };
  97. //+--------------------------------------------------------------------------
  98. // ICertRequest::Submit()
  99. // Flags for request and attributes encoding and type:
  100. const LONG CR_IN_BASE64HEADER = 0x00000000; // BASE64 with begin/end
  101. const LONG CR_IN_BASE64 = 0x00000001; // BASE64 w/o begin/end
  102. const LONG CR_IN_BINARY = 0x00000002; // binary request
  103. const LONG CR_IN_ENCODEANY = 0x000000ff; // Could be any of the above
  104. const LONG CR_IN_ENCODEMASK = 0x000000ff; // request encoding mask
  105. const LONG CR_IN_FORMATANY = 0x00000000; // Could be any of the below
  106. const LONG CR_IN_PKCS10 = 0x00000100; // PKCS 10 request
  107. const LONG CR_IN_KEYGEN = 0x00000200; // Keygen request
  108. const LONG CR_IN_PKCS7 = 0x00000300; // PKCS 7 renewal request
  109. const LONG CR_IN_CMC = 0x00000400; // CMC request
  110. const LONG CR_IN_FORMATMASK = 0x0000ff00; // request format mask
  111. // Cert Server 1.0 obsolete encryption bits:
  112. //const LONG CR_IN_ENCRYPTED_REQUEST = 0x00010000; // request encrypted
  113. //const LONG CR_IN_ENCRYPTED_ATTRIBUTES = 0x00020000; // attributes encrypted
  114. const LONG CR_IN_RPC = 0x00020000; // Use RPC instead of DCOM
  115. const LONG CR_IN_FULLRESPONSE = 0x00040000; // Return CMC Full Response
  116. const LONG CR_IN_CRLS = 0x00080000; // include current CRLs
  117. // Flags for GetConfig flag
  118. const LONG CC_DEFAULTCONFIG = 0x00000000; // ask to get 1st pingable CA
  119. const LONG CC_UIPICKCONFIG = 0x00000001; // invoke UI to pick CA
  120. const LONG CC_FIRSTCONFIG = 0x00000002; // pick first CA
  121. const LONG CC_LOCALCONFIG = 0x00000003; // pick local CA
  122. const LONG CC_LOCALACTIVECONFIG = 0x00000004; // pick local pingable CA
  123. //+--------------------------------------------------------------------------
  124. // ICertRequest::Submit(), ICertRequest::RetrievePending() and
  125. // returned Disposition:
  126. const LONG CR_DISP_INCOMPLETE = 0x00000000; // request did not complete
  127. const LONG CR_DISP_ERROR = 0x00000001; // request failed
  128. const LONG CR_DISP_DENIED = 0x00000002; // request denied
  129. const LONG CR_DISP_ISSUED = 0x00000003; // cert issued
  130. const LONG CR_DISP_ISSUED_OUT_OF_BAND = 0x00000004; // cert issued separately
  131. const LONG CR_DISP_UNDER_SUBMISSION = 0x00000005; // taken under submission
  132. const LONG CR_DISP_REVOKED = 0x00000006; // issued and revoked
  133. //+--------------------------------------------------------------------------
  134. // ICertRequest::GetCACertificate(),
  135. // ICertRequest::GetCertificate(),
  136. // ICertAdmin::GetCRL(),
  137. // ICertRequest2::GetCAProperty(),
  138. // ICertAdmin2::GetCAProperty()
  139. // ICertRequest2::GetFullResponseProperty(),
  140. // Flags for certificate encoding:
  141. const LONG CR_OUT_BASE64HEADER = 0x00000000; // BASE64 with begin/end
  142. const LONG CR_OUT_BASE64 = 0x00000001; // BASE64 w/o begin/end
  143. const LONG CR_OUT_BINARY = 0x00000002; // binary certificate
  144. const LONG CR_OUT_ENCODEMASK = 0x000000ff; // certificate encoding mask
  145. const LONG CR_OUT_CHAIN = 0x00000100; // return certificate chain
  146. const LONG CR_OUT_CRLS = 0x00000200; // chain with current CRLs
  147. //+--------------------------------------------------------------------------
  148. // ICertRequest2::GetErrorMessageText() Flags
  149. const LONG CR_GEMT_HRESULT_STRING = 0x00000001; // Append "0xXX (Win32: DD)"
  150. //+--------------------------------------------------------------------------
  151. // ICertRequest2::GetCAProperty(), ICertAdmin2::GetCAProperty() PropId
  152. cpp_quote("#define CR_PROP_NONE 0 // Invalid")
  153. cpp_quote("#define CR_PROP_FILEVERSION 1 // String")
  154. cpp_quote("#define CR_PROP_PRODUCTVERSION 2 // String")
  155. cpp_quote("#define CR_PROP_EXITCOUNT 3 // Long")
  156. cpp_quote("#define CR_PROP_EXITDESCRIPTION 4 // String, Indexed")
  157. cpp_quote("#define CR_PROP_POLICYDESCRIPTION 5 // String")
  158. cpp_quote("#define CR_PROP_CANAME 6 // String")
  159. cpp_quote("#define CR_PROP_SANITIZEDCANAME 7 // String")
  160. cpp_quote("#define CR_PROP_SHAREDFOLDER 8 // String")
  161. cpp_quote("#define CR_PROP_PARENTCA 9 // String")
  162. cpp_quote("#define CR_PROP_CATYPE 10 // Long")
  163. cpp_quote("#define CR_PROP_CASIGCERTCOUNT 11 // Long")
  164. cpp_quote("#define CR_PROP_CASIGCERT 12 // Binary, Indexed")
  165. cpp_quote("#define CR_PROP_CASIGCERTCHAIN 13 // Binary, Indexed")
  166. cpp_quote("#define CR_PROP_CAXCHGCERTCOUNT 14 // Long")
  167. cpp_quote("#define CR_PROP_CAXCHGCERT 15 // Binary, Indexed")
  168. cpp_quote("#define CR_PROP_CAXCHGCERTCHAIN 16 // Binary, Indexed")
  169. cpp_quote("#define CR_PROP_BASECRL 17 // Binary, Indexed")
  170. cpp_quote("#define CR_PROP_DELTACRL 18 // Binary, Indexed")
  171. cpp_quote("#define CR_PROP_CACERTSTATE 19 // Long, Indexed")
  172. cpp_quote("#define CR_PROP_CRLSTATE 20 // Long, Indexed")
  173. cpp_quote("#define CR_PROP_CAPROPIDMAX 21 // Long")
  174. cpp_quote("#define CR_PROP_DNSNAME 22 // String")
  175. cpp_quote("#define CR_PROP_ROLESEPARATIONENABLED 23 // Long")
  176. cpp_quote("#define CR_PROP_KRACERTUSEDCOUNT 24 // Long")
  177. cpp_quote("#define CR_PROP_KRACERTCOUNT 25 // Long")
  178. cpp_quote("#define CR_PROP_KRACERT 26 // Binary, Indexed")
  179. cpp_quote("#define CR_PROP_KRACERTSTATE 27 // Long, Indexed")
  180. cpp_quote("#define CR_PROP_ADVANCEDSERVER 28 // Long")
  181. cpp_quote("#define CR_PROP_TEMPLATES 29 // String")
  182. cpp_quote("#define CR_PROP_BASECRLPUBLISHSTATUS 30 // Long, Indexed")
  183. cpp_quote("#define CR_PROP_DELTACRLPUBLISHSTATUS 31 // Long, Indexed")
  184. cpp_quote("#define CR_PROP_CASIGCERTCRLCHAIN 32 // Binary, Indexed")
  185. cpp_quote("#define CR_PROP_CAXCHGCERTCRLCHAIN 33 // Binary, Indexed")
  186. cpp_quote("#define CR_PROP_CACERTSTATUSCODE 34 // Long, Indexed")
  187. //+--------------------------------------------------------------------------
  188. // ICertRequest2::GetFullResponseProperty() PropId
  189. cpp_quote("#define FR_PROP_NONE 0 // Invalid")
  190. cpp_quote("#define FR_PROP_FULLRESPONSE 1 // Binary")
  191. cpp_quote("#define FR_PROP_STATUSINFOCOUNT 2 // Long")
  192. cpp_quote("#define FR_PROP_BODYPARTSTRING 3 // String, Indexed")
  193. cpp_quote("#define FR_PROP_STATUS 4 // Long, Indexed")
  194. cpp_quote("#define FR_PROP_STATUSSTRING 5 // String, Indexed")
  195. cpp_quote("#define FR_PROP_OTHERINFOCHOICE 6 // Long, Indexed")
  196. cpp_quote("#define FR_PROP_FAILINFO 7 // Long, Indexed")
  197. cpp_quote("#define FR_PROP_PENDINFOTOKEN 8 // Binary, Indexed")
  198. cpp_quote("#define FR_PROP_PENDINFOTIME 9 // Date, Indexed")
  199. cpp_quote("#define FR_PROP_ISSUEDCERTIFICATEHASH 10 // Binary, Indexed")
  200. cpp_quote("#define FR_PROP_ISSUEDCERTIFICATE 11 // Binary, Indexed")
  201. cpp_quote("#define FR_PROP_ISSUEDCERTIFICATECHAIN 12 // Binary, Indexed")
  202. cpp_quote("#define FR_PROP_ISSUEDCERTIFICATECRLCHAIN 13 // Binary, Indexed")
  203. cpp_quote("#define FR_PROP_ENCRYPTEDKEYHASH 14 // Binary, Indexed")
  204. cpp_quote("#define FR_PROP_FULLRESPONSENOPKCS7 15 // Binary")
  205. //+--------------------------------------------------------------------------
  206. // ICertRequest -- local COM interface, implementation uses DCOM
  207. //+--------------------------------------------------------------------------
  208. [
  209. object,
  210. uuid(014e4840-5523-11d0-8812-00a0c903b83c),
  211. dual,
  212. helpstring("ICertRequest Interface"),
  213. pointer_default(unique)
  214. ]
  215. interface ICertRequest: IDispatch
  216. {
  217. HRESULT Submit(
  218. [in] LONG Flags,
  219. [in] BSTR const strRequest,
  220. [in] BSTR const strAttributes,
  221. [in] BSTR const strConfig,
  222. [out, retval] LONG *pDisposition);
  223. HRESULT RetrievePending(
  224. [in] LONG RequestId,
  225. [in] BSTR const strConfig,
  226. [out, retval] LONG *pDisposition);
  227. HRESULT GetLastStatus(
  228. [out, retval] LONG *pStatus);
  229. HRESULT GetRequestId(
  230. [out, retval] LONG *pRequestId);
  231. HRESULT GetDispositionMessage(
  232. [out, retval] BSTR *pstrDispositionMessage);
  233. HRESULT GetCACertificate(
  234. [in] LONG fExchangeCertificate,
  235. [in] BSTR const strConfig,
  236. [in] LONG Flags, // CR_OUT_*
  237. [out, retval] BSTR *pstrCertificate);
  238. HRESULT GetCertificate(
  239. [in] LONG Flags, // CR_OUT_*
  240. [out, retval] BSTR *pstrCertificate);
  241. };
  242. //+--------------------------------------------------------------------------
  243. // ICertRequest2 -- local COM interface, implementation uses DCOM
  244. //+--------------------------------------------------------------------------
  245. [
  246. object,
  247. uuid(a4772988-4a85-4fa9-824e-b5cf5c16405a),
  248. dual,
  249. helpstring("ICertRequest2 Interface"),
  250. pointer_default(unique)
  251. ]
  252. interface ICertRequest2: ICertRequest
  253. {
  254. HRESULT GetIssuedCertificate(
  255. [in] BSTR const strConfig,
  256. [in] LONG RequestId, // -1: use strSerialNumber
  257. [in] BSTR const strSerialNumber, // OPTIONAL
  258. [out, retval] LONG *pDisposition);
  259. HRESULT GetErrorMessageText(
  260. [in] LONG hrMessage,
  261. [in] LONG Flags,
  262. [out, retval] BSTR *pstrErrorMessageText);
  263. HRESULT GetCAProperty(
  264. [in] BSTR const strConfig,
  265. [in] LONG PropId, // CR_PROP_*
  266. [in] LONG PropIndex,
  267. [in] LONG PropType, // PROPTYPE_*
  268. [in] LONG Flags, // CR_OUT_*
  269. [out, retval] VARIANT *pvarPropertyValue);
  270. HRESULT GetCAPropertyFlags(
  271. [in] BSTR const strConfig,
  272. [in] LONG PropId, // CR_PROP_*
  273. [out, retval] LONG *pPropFlags); // PROPTYPE_* | PROPFLAGS_*
  274. HRESULT GetCAPropertyDisplayName(
  275. [in] BSTR const strConfig,
  276. [in] LONG PropId, // CR_PROP_*
  277. [out, retval] BSTR *pstrDisplayName);
  278. HRESULT GetFullResponseProperty(
  279. [in] LONG PropId, // FR_PROP_*
  280. [in] LONG PropIndex,
  281. [in] LONG PropType, // PROPTYPE_*
  282. [in] LONG Flags, // CR_OUT_*
  283. [out, retval] VARIANT *pvarPropertyValue);
  284. };
  285. //+--------------------------------------------------------------------------
  286. // certcli Type library
  287. //+--------------------------------------------------------------------------
  288. [
  289. uuid(372fce32-4324-11d0-8810-00a0c903b83c),
  290. version(1.0),
  291. helpstring("CertCli 1.0 Type Library")
  292. ]
  293. library CERTCLIENTLib
  294. {
  295. importlib("stdole2.tlb");
  296. //------------------------------------------------
  297. // CCertGetConfig
  298. [
  299. uuid(c6cc49b0-ce17-11d0-8833-00a0c903b83c),
  300. helpstring("CertGetConfig Class")
  301. ]
  302. coclass CCertGetConfig
  303. {
  304. [default] interface ICertGetConfig;
  305. };
  306. //------------------------------------------------
  307. // CCertConfig
  308. [
  309. uuid(372fce38-4324-11d0-8810-00a0c903b83c),
  310. helpstring("CertConfig Class")
  311. ]
  312. coclass CCertConfig
  313. {
  314. [default] interface ICertConfig2;
  315. };
  316. //------------------------------------------------
  317. // CCertRequest
  318. [
  319. uuid(98aff3f0-5524-11d0-8812-00a0c903b83c),
  320. helpstring("CertRequest Class")
  321. ]
  322. coclass CCertRequest
  323. {
  324. [default] interface ICertRequest2;
  325. };
  326. //------------------------------------------------
  327. // CCertServerPolicy
  328. [
  329. uuid(aa000926-ffbe-11cf-8800-00a0c903b83c),
  330. helpstring("CertServerPolicy Class")
  331. ]
  332. coclass CCertServerPolicy
  333. {
  334. [default] interface ICertServerPolicy;
  335. };
  336. //------------------------------------------------
  337. // CCertServerExit
  338. [
  339. uuid(4c4a5e40-732c-11d0-8816-00a0c903b83c),
  340. helpstring("CertServerExit Class")
  341. ]
  342. coclass CCertServerExit
  343. {
  344. [default] interface ICertServerExit;
  345. };
  346. };