home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 September / Chip_2002-09_cd1.bin / zkuste / vbasic / Data / Utils / XZipComp.exe / XceedEncryption.Cab / F113018_MemoryEncryptDlg.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-06-06  |  3.6 KB  |  108 lines

  1. // Xceed Encryption Library - Memory Encrypt sample
  2. // Copyright (c) 2001 Xceed Software Inc.
  3. //
  4. // [MemoryEncryptDlg.h]
  5. //
  6. // This form module contains the main form's code. It demonstrates how to
  7. // Encrypt a chunk of memory data using different kinds of Encryption methods,
  8. // and Decrypt an Encrypted memory data. It specifically uses:
  9. //  - The Encrypt and Decrypt method.
  10. //  - The TODO properties.
  11. //
  12. // This file is part of the Xceed Encryption Library sample applications.
  13. // The source code in this file is only intended as a supplement to Xceed
  14. // Encryption Library's documentation, and is provided "as is", without
  15. // warranty of any kind, either expressed or implied.
  16.  
  17. #if !defined(AFX_MEMORYEncryptDLG_H__56170D64_79FA_432E_AB62_1CF8342F2B91__INCLUDED_)
  18. #define AFX_MEMORYEncryptDLG_H__56170D64_79FA_432E_AB62_1CF8342F2B91__INCLUDED_
  19.  
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23.  
  24. //Here we include the xceedcry.h containing the wrapper classes generated
  25. //by Visual C++ / MFC when we added a class from the xceedcry.dll type 
  26. //library in the Class Wizard
  27. #include "xceedcry.h"
  28.  
  29. /////////////////////////////////////////////////////////////////////////////
  30. // CMemoryEncryptDlg dialog
  31.  
  32. class CMemoryEncryptDlg : public CDialog
  33. {
  34. // Construction
  35. public:
  36.     CMemoryEncryptDlg(CWnd* pParent = NULL);    // standard constructor
  37.  
  38. // Dialog Data
  39.     //{{AFX_DATA(CMemoryEncryptDlg)
  40.     enum { IDD = IDD_MEMORYENCRYPT_DIALOG };
  41.     CString    m_sDecryptedText;
  42.     CString    m_sEncryptedText;
  43.     CString    m_sPassPhrase;
  44.     int        m_nAsymmetricEncryption;
  45.     int        m_nSymmetricEncryption;
  46.     CString    m_sPrivateKeyFile;
  47.     CString    m_sPublicKeyFile;
  48.     //}}AFX_DATA
  49.   //TODO Move above the previous line
  50.  
  51.     // ClassWizard generated virtual function overrides
  52.     //{{AFX_VIRTUAL(CMemoryEncryptDlg)
  53.     protected:
  54.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  55.     //}}AFX_VIRTUAL
  56.  
  57. // Implementation
  58. protected:
  59.     HICON m_hIcon;
  60.  
  61.     // Generated message map functions
  62.     //{{AFX_MSG(CMemoryEncryptDlg)
  63.     virtual BOOL OnInitDialog();
  64.     afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
  65.     afx_msg void OnPaint();
  66.     afx_msg HCURSOR OnQueryDragIcon();
  67.     afx_msg void OnCmdEncrypt();
  68.     afx_msg void OnQuit();
  69.     afx_msg void OnSetfocusTxtDecryptedtext();
  70.     afx_msg void OnSetfocusTxtEncryptedtext();
  71.     afx_msg void OnCmdDecrypt();
  72.     afx_msg void OnCmdOption();
  73.     afx_msg void OnCmdRandomkeypair();
  74.     afx_msg void OnCmdSelprivatekeyfile();
  75.     afx_msg void OnCmdSelpublickeyfile();
  76.     afx_msg void OnRdoAsymmetricencryption();
  77.     afx_msg void OnRdoSymmetricencryption();
  78.     afx_msg void OnKillfocusTxtPrivatekeyfile();
  79.     afx_msg void OnKillfocusTxtPublickeyfile();
  80.     //}}AFX_MSG
  81.     DECLARE_MESSAGE_MAP()
  82.  
  83.   //Utility functions
  84.   void EnableControls();
  85.   void PrepareEncryptionMethod( DXceedEncryption& xEncryptor );
  86.   void LoadOption();
  87.   void ReadKeyFile( LPCSTR sKeyFileName, 
  88.                     DXceedEncryption* pxEncryptor, 
  89.                     COleVariant* pvaKey );
  90.   void SaveOption();
  91.   void SaveEncryptionType();
  92.   void SavePrivateKeyFileSetting();
  93.   void SavePublicKeyFileSetting();
  94.   CString SelectKeyFile();
  95.  
  96.   // The values chosen by the user in the Option form
  97.   enuEncryptionMethod m_eEncryptionMethod;
  98.   enuEncryptionMode m_eEncryptionMode;
  99.   enuPaddingMethod m_ePaddingMethod;
  100.   enuHashingMethod m_eHashingMethod;
  101.   short m_nSecretKeySize;
  102. };
  103.  
  104. //{{AFX_INSERT_LOCATION}}
  105. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  106.  
  107. #endif // !defined(AFX_MEMORYEncryptDLG_H__56170D64_79FA_432E_AB62_1CF8342F2B91__INCLUDED_)
  108.