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.

61 lines
1.8 KiB

  1. class SMimeEncode
  2. {
  3. public:
  4. SMimeEncode();
  5. ~SMimeEncode();
  6. HRESULT HrConfig(DWORD dwFlags,
  7. LPTSTR lpszBody,
  8. HCRYPTPROV hCryptProv,
  9. HCERTSTORE hMYCertStore,
  10. HCERTSTORE hCACertStore,
  11. HCERTSTORE hABCertStore,
  12. PCCERT_CONTEXT lpSigningCertInner,
  13. PCCERT_CONTEXT lpSigningCertOuter,
  14. PCCERT_CONTEXT lpEncryptionCert,
  15. LPTSTR lpszSenderEmail,
  16. LPTSTR lpszSenderName,
  17. LPTSTR lpszRecipientEmail,
  18. LPTSTR lpszRecipientName,
  19. LPTSTR lpszOutputFile
  20. );
  21. HRESULT HrExecute(void);
  22. protected:
  23. DWORD m_dwFlags; // signing and encryption options
  24. IStream * m_stmOutput; // output stream
  25. LPTSTR m_szSignAlg;
  26. LPTSTR m_szEncryptAlg;
  27. LPTSTR m_szBody; // Body string.
  28. LPTSTR m_szSubject; // Subject string.
  29. CERT_CONTEXT* m_SigningCertInner;
  30. CERT_CONTEXT* m_SigningCertOuter;
  31. CERT_CONTEXT* m_EncryptionCert; // maybe should be multiple?
  32. HCRYPTPROV m_hCryptProv;
  33. HCERTSTORE m_hMYCertStore;
  34. HCERTSTORE m_hCACertStore;
  35. HCERTSTORE m_hABCertStore;
  36. LPTSTR m_szSenderEmail;
  37. LPTSTR m_szSenderName;
  38. LPTSTR m_szRecipientEmail; // maybe should be multiple?
  39. LPTSTR m_szRecipientName;
  40. LPTSTR m_szOutputFile;
  41. };
  42. typedef class SMimeEncode SMimeEncode;
  43. // Values for dwFlags
  44. #define encode_Encrypt 0x1
  45. #define encode_InnerSign 0x2
  46. #define encode_OuterSign 0x4
  47. #define encode_InnerClear 0x8
  48. #define encode_InnerOpaque 0
  49. #define encode_OuterClear 0x10
  50. #define encode_OuterOpaque 0