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.

704 lines
17 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1995 - 1999
  6. //
  7. // File: certut.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #include "resource.h"
  11. const DWORD KMS_LOCKBOX_TAG = 1;
  12. const DWORD KMS_SIGNING_CERT_TAG = 2;
  13. const DWORD KMS_SIGNATURE_TAG = 3;
  14. const DWORD KMS_USER_RECORD_TAG = 4;
  15. typedef struct _TagHeader {
  16. DWORD tag;
  17. DWORD cbSize;
  18. } TagHeader;
  19. typedef DWORD CERTFLAGS;
  20. const CERTFLAGS CERTFLAGS_ALL = 0xFFFFFFFF;
  21. const CERTFLAGS CERTFLAGS_UNKNOWN = 0x00000000;
  22. // nibble reserved for version number V
  23. const CERTFLAGS CERTFLAGS_REVOKED = 0x00000001;
  24. const CERTFLAGS CERTFLAGS_NOT_EXPIRED = 0x00000002;
  25. const CERTFLAGS CERTFLAGS_SIGNING = 0x00000004;
  26. const CERTFLAGS CERTFLAGS_SEALING = 0x00000008;
  27. const CERTFLAGS CERTFLAGS_CURRENT = 0x00000010;
  28. const CERTFLAGS CERTFLAGS_IMPORTED = 0x00000100;
  29. // these are broken V1 certs, not standard version 1
  30. const CERTFLAGS CERTFLAGS_VERSION_1 = 0x00001000;
  31. // KMServer does not use version 2 certs
  32. // const CERTFLAGS CERTFLAGS_VERSION_2 = 0x00002000;
  33. // these are proper version 3 certs
  34. const CERTFLAGS CERTFLAGS_VERSION_3 = 0x00003000;
  35. #define wszKMSCERTSTATUS L"KMS.status"
  36. #define cwcAUTOPASSWORDMAX 16
  37. #define wszCUREGDSTEMPLATEFLAGS L"DSTemplateFlags"
  38. #define wszCUREGDSCAFLAGS L"DSCAFlags"
  39. #define wszCUREGDSOIDFLAGS L"DSOIDFlags"
  40. #define wszREQUESTCLIENTID L"RequestClientId"
  41. extern WCHAR const g_wszAppName[];
  42. extern WCHAR const *g_pwszProg;
  43. extern HINSTANCE g_hInstance;
  44. extern WCHAR const g_wszAttrib[];
  45. extern WCHAR const g_wszExt[];
  46. extern WCHAR const g_wszCRL[];
  47. extern BOOL g_fIDispatch;
  48. extern BOOL g_fEnterpriseRegistry;
  49. extern BOOL g_fUserRegistry;
  50. extern BOOL g_fUserTemplates;
  51. extern BOOL g_fMachineTemplates;
  52. extern BOOL g_fFullUsage;
  53. extern BOOL g_fReverse;
  54. extern BOOL g_fForce;
  55. extern BOOL g_fVerbose;
  56. extern BOOL g_fGMT;
  57. extern BOOL g_fSeconds;
  58. extern BOOL g_fDispatch;
  59. extern DWORD g_DispatchFlags;
  60. extern BOOL g_fQuiet;
  61. extern DWORD g_EncodeFlags;
  62. extern DWORD g_CryptEncodeFlags;
  63. extern BOOL g_fCryptSilent;
  64. extern BOOL g_fV1Interface;
  65. extern BOOL g_fSplitASN;
  66. extern BOOL g_fAdminInterface;
  67. extern BOOL g_fProtect;
  68. extern BOOL g_fWeakPFX;
  69. extern BOOL g_fURLFetch;
  70. extern DWORD g_dwmsTimeout;
  71. extern WCHAR *g_pwszConfig;
  72. extern WCHAR *g_pwszDC;
  73. extern WCHAR *g_pwszOut;
  74. extern WCHAR *g_pwszPassword;
  75. extern WCHAR *g_pwszCSP;
  76. extern WCHAR *g_pwszRestrict;
  77. extern WCHAR *g_pwszDnsName;
  78. extern WCHAR *g_pwszOldName;
  79. extern WCHAR const g_wszEmpty[];
  80. extern WCHAR const g_wszPad2[];
  81. extern WCHAR const g_wszPad4[];
  82. extern WCHAR const g_wszPad6[];
  83. extern WCHAR const g_wszPad8[];
  84. extern WCHAR const wszNewLine[];
  85. extern UINT g_uiExtraErrorInfo;
  86. extern WCHAR const g_wszSchema[];
  87. extern WCHAR const g_wszEncode[];
  88. extern WCHAR const g_wszEncodeHex[];
  89. extern WCHAR const g_wszViewDelStore[];
  90. extern WCHAR const g_wszCACert[];
  91. extern WCHAR const g_wszCAChain[];
  92. extern WCHAR const g_wszGetCRL[];
  93. extern WCHAR const g_wszCAInfo[];
  94. extern WCHAR const g_wszCAInfoCRL[];
  95. extern CRITICAL_SECTION g_DBCriticalSection;
  96. typedef HRESULT (FNVERB)(
  97. IN WCHAR const *pwszOption,
  98. IN WCHAR const *pwszArg1,
  99. IN WCHAR const *pwszArg2,
  100. IN WCHAR const *pwszArg3,
  101. IN WCHAR const *pwszArg4);
  102. FNVERB verbUsage, verbDump, verbGetConfig,
  103. verbGetConfig2, verbGetCACertificate, verbVerifyKeys, verbVerifyCert,
  104. verbCheck7f, verbHexTranslate, verbBase64Translate, verbDenyRequest,
  105. verbResubmitRequest, verbRevokeCertificate, verbSetAttributes,
  106. verbSetExtension, verbPublishCRL, verbGetCRL, verbIsValidCertificate,
  107. verbViewDump, verbDBDump, verbPing, verbPingAdmin, verbShutDownServer,
  108. verbBackupPFX, verbRestorePFX, verbStore, verbBackupDB, verbRestoreDB,
  109. verbCSPList, verbCSPTest, verbBackup, verbRestore, verbAddStore,
  110. verbDelStore, verbVerifyStore, verbOIDName, verbImportCertificate,
  111. verbDynamicFileList, verbDatabaseLocations, verbGetReg, verbSetReg,
  112. verbErrorDump, verbCreateVRoots, verbConvertMDB, verbGetConfig3,
  113. verbSetMapiInfo, verbGetMapiInfo, verbInstallCACert, verbRenewCACert,
  114. verbKey, verbDelKey, verbExtractMDB, verbDS, verbDSDel, verbDSPublish,
  115. verbDSCert, verbDSCRL, verbDSDeltaCRL, verbGetCAInfo, verbGetCAPropInfo,
  116. verbGetCertFromUI, verbMACFile, verbGetKey, verbRecoverKey,
  117. verbRepairStore, verbDelReg, verbExportPVK, verbExportPFX, verbImportPFX,
  118. verbDSTemplate, verbDSAddTemplate, verbTemplate, verbTemplateCAs,
  119. verbCATemplates, verbImportKMS, verbURLCache, verbSign, verbDeleteRow,
  120. verbPulse, verbMachineInfo, verbDCInfo, verbEntInfo, verbTCAInfo,
  121. verbViewOrDeleteStore, verbSCInfo, verbMergePFX, verbURL, verbConvertEPF,
  122. verbSetCATemplates;
  123. HRESULT
  124. cuGetCAInfo(
  125. IN WCHAR const *pwszOption,
  126. OPTIONAL IN WCHAR const *pwszfnOut,
  127. OPTIONAL IN WCHAR const *pwszInfoName,
  128. OPTIONAL IN WCHAR const *pwszNumber);
  129. HRESULT
  130. cuGetLocalCANameFromConfig(
  131. OPTIONAL OUT WCHAR **ppwszMachine,
  132. OPTIONAL OUT WCHAR **ppwszCA);
  133. HRESULT
  134. cuSetConfig();
  135. HRESULT
  136. cuSanitizeNameWithSuffix(
  137. IN WCHAR const *pwszName,
  138. OUT WCHAR **ppwszNameOut);
  139. HRESULT
  140. cuGenerateKeyContainerName(
  141. IN CERT_CONTEXT const *pcc,
  142. OUT WCHAR **ppwszKeyContainerName);
  143. VOID
  144. cuPrintError(
  145. IN DWORD idmsg,
  146. IN HRESULT hr);
  147. VOID
  148. cuPrintAPIError(
  149. IN WCHAR const *pwszAPIName,
  150. IN HRESULT hr);
  151. VOID
  152. cuPrintErrorAndString(
  153. OPTIONAL IN WCHAR const *pwszProc,
  154. IN DWORD idmsg,
  155. IN HRESULT hr,
  156. OPTIONAL IN WCHAR const *pwszString);
  157. VOID
  158. cuPrintErrorMessageText(
  159. IN HRESULT hr);
  160. BOOL
  161. cuParseDecimal(
  162. IN OUT WCHAR const **ppwc,
  163. IN OUT DWORD *pcwc,
  164. OUT DWORD *pdw);
  165. HRESULT
  166. cuParseStrings(
  167. IN WCHAR const *pwszStrings,
  168. IN BOOL fMatchPrefix,
  169. OPTIONAL IN WCHAR const *pwszPrefix,
  170. OPTIONAL IN WCHAR const * const *apwszAllowedPrefixes,
  171. OUT WCHAR ***papwszStrings,
  172. OPTIONAL OUT BOOL *pfAllFields);
  173. VOID
  174. cuFreeStringArray(
  175. IN OUT WCHAR **apwsz);
  176. VOID
  177. cuFreeStringArrayA(
  178. IN OUT char **apsz);
  179. VOID
  180. cuConvertEscapeSequences(
  181. IN OUT WCHAR *pwsz);
  182. HRESULT
  183. cuGeneratePassword(
  184. IN DWORD cwcMax,
  185. OUT WCHAR *pwszPassword,
  186. IN DWORD cwcPassword);
  187. HRESULT
  188. cuGetPassword(
  189. OPTIONAL IN UINT idsPrompt,
  190. OPTIONAL IN WCHAR const *pwszfn,
  191. OPTIONAL IN WCHAR const *pwszPasswordIn,
  192. IN BOOL fVerify,
  193. OUT WCHAR *pwszPassword,
  194. IN DWORD cwcPassword,
  195. OUT WCHAR const **ppwszPasswordOut);
  196. HRESULT
  197. cuDumpFileTimePeriod(
  198. IN DWORD idMessage,
  199. OPTIONAL IN WCHAR const *pwszQuote,
  200. IN FILETIME const *pftGMT);
  201. HRESULT
  202. cuDumpFileTime(
  203. IN DWORD idMessage,
  204. OPTIONAL IN WCHAR const *pwszQuote,
  205. IN FILETIME const *pftGMT);
  206. HRESULT
  207. cuDumpFileTimeOrPeriod(
  208. IN DWORD idMessage,
  209. OPTIONAL IN WCHAR const *pwszQuote,
  210. IN FILETIME const *pftGMT);
  211. HRESULT
  212. cuDumpDate(
  213. IN DATE const *pDate);
  214. VOID
  215. cuDumpSignature(
  216. OPTIONAL IN CERT_SIGNED_CONTENT_INFO const *pcsci);
  217. HRESULT
  218. cuDumpFormattedProperty(
  219. IN DWORD dwPropId,
  220. OPTIONAL IN char const *pszObjId,
  221. IN BYTE const *pb,
  222. IN DWORD cb);
  223. HRESULT
  224. cuDecodeObjId(
  225. IN BYTE const *pbData,
  226. IN DWORD cbData,
  227. char **ppszObjId);
  228. HRESULT
  229. cuEncodeObjId(
  230. IN char const *pszObjId,
  231. OUT BYTE **ppbData,
  232. OUT DWORD *pcbData);
  233. HRESULT
  234. cuDecodeSequence(
  235. IN BYTE const *pbSeq,
  236. IN DWORD cbSeq,
  237. IN DWORD cSeq,
  238. OUT CRYPT_SEQUENCE_OF_ANY **ppSeq);
  239. VOID
  240. cuDumpAlgorithm(
  241. IN DWORD idMessage,
  242. IN CRYPT_ALGORITHM_IDENTIFIER const *pAlg);
  243. BOOL
  244. cuDumpFormattedExtension(
  245. IN WCHAR const *pwszName,
  246. IN BYTE const *pbObject,
  247. IN DWORD cbObject);
  248. HRESULT
  249. cuDumpExtensionArray(
  250. IN DWORD idMessage,
  251. IN DWORD cExtension,
  252. IN CERT_EXTENSION const *rgExtension);
  253. HRESULT
  254. cuDumpSerial(
  255. OPTIONAL IN WCHAR const *pwszPrefix,
  256. IN DWORD idMessage,
  257. IN CRYPT_INTEGER_BLOB const *pSerial);
  258. HRESULT
  259. cuDumpPrivateKey(
  260. IN CERT_CONTEXT const *pCert,
  261. OPTIONAL OUT BOOL *pfSigningKey,
  262. OPTIONAL OUT BOOL *pfMatchingKey);
  263. VOID
  264. cuDumpPublicKey(
  265. IN CERT_PUBLIC_KEY_INFO const *pKey);
  266. VOID
  267. cuDumpAlgid(
  268. IN DWORD Algid);
  269. VOID
  270. cuDumpVersion(
  271. IN DWORD dwVersion);
  272. HRESULT
  273. cuDumpPrivateKeyBlob(
  274. IN BYTE const *pbKey,
  275. IN DWORD cbKey,
  276. IN BOOL fQuiet);
  277. HRESULT
  278. cuDumpCertKeyProviderInfo(
  279. IN WCHAR const *pwszPrefix,
  280. OPTIONAL IN CERT_CONTEXT const *pCert,
  281. OPTIONAL IN CRYPT_KEY_PROV_INFO *pkpi,
  282. OPTIONAL OUT CRYPT_KEY_PROV_INFO **ppkpi);
  283. HRESULT
  284. EPFFileDump(
  285. IN WCHAR const *pwszfn,
  286. OPTIONAL IN WCHAR const *pwszPassword,
  287. OPTIONAL IN OUT HCERTSTORE hStore);
  288. #define EPFALG_DEFAULT 0
  289. #define EPFALG_CASTEXPORT 1
  290. #define EPFALG_CAST 2
  291. HRESULT
  292. EPFSaveCertStoreToFile(
  293. IN HCERTSTORE hStore,
  294. IN WCHAR const *pwszPassword,
  295. IN WCHAR const *pwszfnOut,
  296. OPTIONAL IN WCHAR const *pwszV3CACertId,
  297. IN DWORD dwEPFAlg,
  298. OPTIONAL IN WCHAR const *pwszSalt);
  299. HRESULT
  300. myVerifyKMSKey(
  301. IN BYTE const *pbCert,
  302. IN DWORD cbCert,
  303. IN BYTE const *pbKey,
  304. IN DWORD cbKey,
  305. IN DWORD dwKeySpec,
  306. IN BOOL fQuiet);
  307. #define BLOB_ROUND(cb) \
  308. (((cb) + sizeof(CRYPT_DATA_BLOB) - 1) / sizeof(CRYPT_DATA_BLOB))
  309. HRESULT
  310. myDecodeKMSRSAKey(
  311. IN BYTE const *pbKMSRSAKey,
  312. IN DWORD cbKMSRSAKey,
  313. IN ALG_ID aiKeyAlg,
  314. OUT BYTE **ppbKey,
  315. OUT DWORD *pcbKey);
  316. HRESULT
  317. myEncodeKMSRSAKey(
  318. IN BYTE const *pbKey,
  319. IN DWORD cbKey,
  320. OUT BYTE **ppbKMSRSAKey,
  321. OUT DWORD *pcbKMSRSAKey);
  322. HRESULT
  323. cuDumpAsnBinary(
  324. IN BYTE const *pbIn,
  325. IN DWORD cbIn,
  326. IN DWORD iElement);
  327. HRESULT
  328. cuDumpAsnBinaryQuiet(
  329. IN BYTE const *pb,
  330. IN DWORD cb,
  331. IN DWORD iElement);
  332. HRESULT
  333. cuSaveAsnToFile(
  334. IN BYTE const *pbIn,
  335. IN DWORD cbIn,
  336. IN int imajor,
  337. IN int ilevel,
  338. IN DWORD iElement,
  339. IN WCHAR const *pwszExtension);
  340. #define DVNS_DUMP 0x000000000
  341. #define DVNS_VERIFYCERT 0x000000001
  342. #define DVNS_REPAIRKPI 0x000000002
  343. #define DVNS_CASTORE 0x000000004
  344. #define DVNS_DUMPKEYS 0x000000008
  345. #define DVNS_DUMPPROPERTIES 0x000000010
  346. #define DVNS_SAVECERT 0x000000100
  347. #define DVNS_SAVECRL 0x000000200
  348. #define DVNS_SAVECTL 0x000000400
  349. #define DVNS_SAVEPFX 0x000000800
  350. #define DVNS_SAVEPVK 0x000001000
  351. #define DVNS_WRITESTORE 0x000002000
  352. #define DVNS_DSSTORE 0x000004000
  353. HRESULT
  354. cuOpenCertStore(
  355. IN WCHAR const *pwszStoreName,
  356. IN OUT DWORD *pMode,
  357. OPTIONAL OUT WCHAR **ppwszStoreNameOut,
  358. OUT HCERTSTORE *phStore);
  359. HRESULT
  360. cuDumpAndVerifyStore(
  361. IN HCERTSTORE hStore,
  362. IN DWORD Mode,
  363. OPTIONAL IN WCHAR const *pwszCertName,
  364. IN DWORD iCertSave,
  365. IN DWORD iCRLSave,
  366. IN DWORD iCTLSave,
  367. OPTIONAL IN WCHAR const *pwszfnOut,
  368. OPTIONAL IN WCHAR const *pwszPassword);
  369. VOID
  370. cuDumpOIDAndDescriptionA(
  371. IN char const *pszObjId);
  372. VOID
  373. cuDumpOIDAndDescription(
  374. IN WCHAR const *pwszObjId);
  375. WCHAR const *
  376. cuwszFromExtFlags(
  377. IN DWORD ExtFlags);
  378. WCHAR const *
  379. cuwszPropType(
  380. IN LONG PropType);
  381. BOOL
  382. cuRegPrintDwordValue(
  383. IN BOOL fPrintNameAndValue,
  384. IN WCHAR const *pwszLookupName,
  385. IN WCHAR const *pwszDisplayName,
  386. IN DWORD dwValue);
  387. VOID
  388. cuRegPrintAwszValue(
  389. IN WCHAR const *pwszName,
  390. OPTIONAL IN WCHAR const * const *prgpwszValues);
  391. VOID
  392. cuPrintSchemaEntry(
  393. OPTIONAL IN WCHAR const *pwszName,
  394. IN WCHAR const *pwszDisplayName,
  395. IN LONG Type,
  396. IN LONG cbMax);
  397. VOID
  398. cuUnloadCert(
  399. IN OUT CERT_CONTEXT const **ppCertContext);
  400. HRESULT
  401. cuLoadCert(
  402. IN WCHAR const *pwszfnCert,
  403. OUT CERT_CONTEXT const **ppCertContext);
  404. VOID
  405. cuUnloadCRL(
  406. IN OUT CRL_CONTEXT const **ppCRLContext);
  407. HRESULT
  408. cuLoadCRL(
  409. IN WCHAR const *pwszfnCRL,
  410. OUT CRL_CONTEXT const **ppCRLContext);
  411. HRESULT
  412. cuVerifySignature(
  413. IN BYTE const *pbEncoded,
  414. IN DWORD cbEncoded,
  415. IN CERT_PUBLIC_KEY_INFO const *pcpki,
  416. IN BOOL fSuppressSuccess,
  417. IN BOOL fSuppressError);
  418. HRESULT
  419. cuDumpIssuerSerialAndSubject(
  420. IN CERT_NAME_BLOB const *pIssuer,
  421. IN CRYPT_INTEGER_BLOB const *pSerialNumber,
  422. OPTIONAL IN CERT_NAME_BLOB const *pSubject,
  423. OPTIONAL IN HCERTSTORE hStore);
  424. HRESULT
  425. cuDumpSigners(
  426. IN HCRYPTMSG hMsg,
  427. IN CHAR const *pszInnerContentObjId,
  428. IN HCERTSTORE hStore,
  429. IN DWORD cSigner,
  430. IN BOOL fContentEmpty,
  431. IN BOOL fVerifyOnly,
  432. OPTIONAL OUT BYTE *pbHashUserCert,
  433. OPTIONAL IN OUT DWORD *pcbHashUserCert);
  434. HRESULT
  435. cuDumpRecipients(
  436. IN HCRYPTMSG hMsg,
  437. IN HCERTSTORE hStoreWrapper,
  438. IN DWORD cRecipient,
  439. IN BOOL fQuiet);
  440. HRESULT
  441. cuDumpEncryptedAsnBinary(
  442. IN HCRYPTMSG hMsg,
  443. IN DWORD cRecipient,
  444. IN DWORD RecipientIndex,
  445. OPTIONAL IN HCERTSTORE hStoreWrapper,
  446. IN HCERTSTORE hStorePKCS7,
  447. IN BYTE const *pbIn,
  448. IN DWORD cbIn,
  449. IN BOOL fQuiet,
  450. OPTIONAL OUT BYTE **ppbDecrypted,
  451. OPTIONAL OUT DWORD *pcbDecrypted);
  452. #define VS_OTHERERROR 0x00000001
  453. #define VS_EXPIRED 0x00000002
  454. #define VS_REVOKED 0x00000004
  455. #define VS_UNTRUSTEDROOT 0x00000008
  456. #define VS_INCOMPLETECHAIN 0x00000010
  457. #define VS_NOREVOCATIONCHECK 0x00000020
  458. #define VS_REVOCATIONOFFLINE 0x00000040
  459. #define VS_ROOT 0x40000000
  460. #define VS_ROOTSIGOK 0x80000000
  461. #define VS_ERRORMASK (VS_OTHERERROR | \
  462. VS_EXPIRED | \
  463. VS_REVOKED | \
  464. VS_UNTRUSTEDROOT | \
  465. VS_INCOMPLETECHAIN)
  466. HRESULT
  467. cuVerifyCertContext(
  468. IN CERT_CONTEXT const *pCert,
  469. OPTIONAL IN HCERTSTORE hStoreCA,
  470. IN DWORD cApplicationPolicies,
  471. OPTIONAL IN char const * const *apszApplicationPolicies,
  472. IN DWORD cIssuancePolicies,
  473. OPTIONAL IN char const * const *apszIssuancePolicies,
  474. IN BOOL fNTAuth,
  475. OUT DWORD *pVerifyState);
  476. VOID
  477. cuDisplayCDPUrlsFromCertOrCRL(
  478. OPTIONAL IN CERT_CONTEXT const *pCert,
  479. OPTIONAL IN CRL_CONTEXT const *pCRL);
  480. VOID
  481. cuDisplayAIAUrlsFromCert(
  482. IN CERT_CONTEXT const *pCert);
  483. HRESULT
  484. cuDisplayCertName(
  485. IN BOOL fMultiLine,
  486. OPTIONAL IN WCHAR const *pwszNamePrefix,
  487. IN WCHAR const *pwszName,
  488. IN WCHAR const *pwszPad,
  489. IN CERT_NAME_BLOB const *pNameBlob,
  490. OPTIONAL IN CERT_INFO const *pCertInfo);
  491. HRESULT
  492. cuDisplayCertNames(
  493. IN BOOL fMultiLine,
  494. OPTIONAL IN WCHAR const *pwszNamePrefix,
  495. IN CERT_INFO const *pCertInfo);
  496. HRESULT
  497. cuDisplayKeyId(
  498. IN CERT_PUBLIC_KEY_INFO const *pPublicKeyInfo,
  499. IN DWORD cExtension,
  500. OPTIONAL IN CERT_EXTENSION const *rgExtension);
  501. HRESULT
  502. cuDisplayHash(
  503. OPTIONAL IN WCHAR const *pwszPrefix,
  504. OPTIONAL IN CERT_CONTEXT const *pCertContext,
  505. OPTIONAL IN CRL_CONTEXT const *pCRLContext,
  506. IN DWORD dwPropId,
  507. IN WCHAR const *pwszHashName);
  508. VOID
  509. cuDisplayCAType(
  510. IN LONG CAType);
  511. HRESULT
  512. cuGetCertType(
  513. IN CERT_INFO const *pCertInfo,
  514. OPTIONAL OUT WCHAR **ppwszCertTypeNameV1,
  515. OPTIONAL OUT WCHAR **ppwszDisplayNameV1,
  516. OPTIONAL OUT WCHAR **ppwszCertTypeObjId,
  517. OPTIONAL OUT WCHAR **ppwszCertTypeName,
  518. OPTIONAL OUT WCHAR **ppwszDisplayName);
  519. HRESULT
  520. cuGetGroupMembership(
  521. IN WCHAR const *pwszSamName);
  522. HRESULT
  523. cuDumpCertType(
  524. OPTIONAL IN WCHAR const *pwszPrefix,
  525. IN CERT_INFO const *pCertInfo);
  526. HRESULT
  527. cuGetTemplateNames(
  528. IN WCHAR const *pwszTemplate,
  529. OUT WCHAR **ppwszCN,
  530. OUT WCHAR **ppwszDisplayName);
  531. VOID
  532. cuPrintCRLFString(
  533. IN WCHAR const *pwszPrefix,
  534. IN WCHAR const *pwszIn);
  535. int
  536. cuidCRLReason(
  537. IN LONG Reason);
  538. WCHAR const *
  539. cuGetOIDNameA(
  540. IN char const *pszObjId);
  541. WCHAR const *
  542. cuGetOIDName(
  543. IN WCHAR const *pwszObjId);
  544. VOID
  545. cuPrintPossibleObjectIdName(
  546. IN WCHAR const *pwszObjId);
  547. HRESULT
  548. cuLoadKeys(
  549. OPTIONAL IN WCHAR const *pwszProvName,
  550. IN OUT DWORD *pdwProvType,
  551. IN WCHAR const *pwszKeyContainerName,
  552. IN BOOL fMachineKeyset,
  553. IN BOOL fSoftFail,
  554. OPTIONAL OUT HCRYPTPROV *phProv,
  555. OPTIONAL OUT CERT_PUBLIC_KEY_INFO **ppPubKeyInfo,
  556. OPTIONAL OUT CERT_PUBLIC_KEY_INFO **ppPubKeyInfoXchg);
  557. VOID
  558. cuCAInfoUsage(VOID);
  559. DWORD
  560. cuFileSize(
  561. IN WCHAR const *pwszfn);
  562. HRESULT
  563. cuPingCertSrv(
  564. IN WCHAR const *pwszConfig,
  565. OPTIONAL OUT CAINFO **ppCAInfo);
  566. DWORD
  567. cuGetSystemStoreFlags();
  568. HRESULT
  569. cuVerifyKeyAuthority(
  570. IN CERT_NAME_BLOB const *pIssuer,
  571. IN CERT_INFO const *pCertInfoCA,
  572. IN BYTE const *pbData,
  573. IN DWORD cbData,
  574. IN BOOL fQuiet,
  575. OUT BOOL *pfKeyAuthorityMatch);
  576. BOOL
  577. cuVerifyMinimumBaseCRL(
  578. IN CRL_CONTEXT const *pCRLBase,
  579. IN CRL_CONTEXT const *pCRLDelta);
  580. BOOL
  581. cuVerifyIDP(
  582. IN CERT_CONTEXT const *pCertSubject,
  583. IN CRL_CONTEXT const *pCRL);