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.

57 lines
1.7 KiB

  1. #ifndef __CERT_REQUESTER_H__
  2. #define __CERT_REQUESTER_H__ 1
  3. class CertRequester {
  4. public:
  5. CertDSManager * GetDSManager() { return m_pDSManager; }
  6. CertRequesterContext * GetContext() { return m_pContext; }
  7. virtual ~CertRequester()
  8. {
  9. if (NULL != m_pDSManager) { delete m_pDSManager; }
  10. if (NULL != m_pContext) { delete m_pContext; }
  11. }
  12. static HRESULT MakeCertRequester(IN LPCWSTR pwszAccountName,
  13. IN LPCWSTR pwszMachineName,
  14. IN DWORD dwCertOpenStoreFlags,
  15. IN DWORD dwPurpose,
  16. IN CERT_WIZARD_INFO *pCertWizardInfo,
  17. OUT CertRequester **ppCertRequester,
  18. OUT UINT *pIDS);
  19. protected:
  20. CertRequester();
  21. CertRequester(CERT_WIZARD_INFO * pCertWizardInfo) : m_pCertWizardInfo(pCertWizardInfo),
  22. m_pDSManager(NULL), m_pContext(NULL) {
  23. if (NULL != pCertWizardInfo) { pCertWizardInfo->hRequester = (HCERTREQUESTER)this; }
  24. }
  25. private:
  26. // FIXME: does pContext need to be refcounted?
  27. void SetContext(CertRequesterContext * pContext) { m_pContext = pContext; }
  28. void SetDSManager(CertDSManager * pDSManager) { m_pDSManager = pDSManager; }
  29. CERT_WIZARD_INFO *m_pCertWizardInfo;
  30. CertDSManager *m_pDSManager;
  31. CertRequesterContext *m_pContext;
  32. };
  33. class EnrollmentCertRequester : public CertRequester {
  34. public:
  35. EnrollmentCertRequester(CERT_WIZARD_INFO * pCertWizardInfo) : CertRequester(pCertWizardInfo)
  36. { }
  37. };
  38. class RenewalCertRequester : public CertRequester {
  39. public:
  40. RenewalCertRequester(CERT_WIZARD_INFO * pCertWizardInfo) : CertRequester(pCertWizardInfo)
  41. { }
  42. };
  43. #endif // #ifndef __CERT_REQUESTER_H__