home *** CD-ROM | disk | FTP | other *** search
- // Xceed Encryption Library - Memory Encrypt sample
- // Copyright (c) 2001 Xceed Software Inc.
- //
- // [MemoryEncryptDlg.h]
- //
- // This form module contains the main form's code. It demonstrates how to
- // Encrypt a chunk of memory data using different kinds of Encryption methods,
- // and Decrypt an Encrypted memory data. It specifically uses:
- // - The Encrypt and Decrypt method.
- // - The TODO properties.
- //
- // This file is part of the Xceed Encryption Library sample applications.
- // The source code in this file is only intended as a supplement to Xceed
- // Encryption Library's documentation, and is provided "as is", without
- // warranty of any kind, either expressed or implied.
-
- #if !defined(AFX_MEMORYEncryptDLG_H__56170D64_79FA_432E_AB62_1CF8342F2B91__INCLUDED_)
- #define AFX_MEMORYEncryptDLG_H__56170D64_79FA_432E_AB62_1CF8342F2B91__INCLUDED_
-
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
-
- //Here we include the xceedcry.h containing the wrapper classes generated
- //by Visual C++ / MFC when we added a class from the xceedcry.dll type
- //library in the Class Wizard
- #include "xceedcry.h"
-
- /////////////////////////////////////////////////////////////////////////////
- // CMemoryEncryptDlg dialog
-
- class CMemoryEncryptDlg : public CDialog
- {
- // Construction
- public:
- CMemoryEncryptDlg(CWnd* pParent = NULL); // standard constructor
-
- // Dialog Data
- //{{AFX_DATA(CMemoryEncryptDlg)
- enum { IDD = IDD_MEMORYENCRYPT_DIALOG };
- CString m_sDecryptedText;
- CString m_sEncryptedText;
- CString m_sPassPhrase;
- int m_nAsymmetricEncryption;
- int m_nSymmetricEncryption;
- CString m_sPrivateKeyFile;
- CString m_sPublicKeyFile;
- //}}AFX_DATA
- //TODO Move above the previous line
-
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMemoryEncryptDlg)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
- // Implementation
- protected:
- HICON m_hIcon;
-
- // Generated message map functions
- //{{AFX_MSG(CMemoryEncryptDlg)
- virtual BOOL OnInitDialog();
- afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
- afx_msg void OnPaint();
- afx_msg HCURSOR OnQueryDragIcon();
- afx_msg void OnCmdEncrypt();
- afx_msg void OnQuit();
- afx_msg void OnSetfocusTxtDecryptedtext();
- afx_msg void OnSetfocusTxtEncryptedtext();
- afx_msg void OnCmdDecrypt();
- afx_msg void OnCmdOption();
- afx_msg void OnCmdRandomkeypair();
- afx_msg void OnCmdSelprivatekeyfile();
- afx_msg void OnCmdSelpublickeyfile();
- afx_msg void OnRdoAsymmetricencryption();
- afx_msg void OnRdoSymmetricencryption();
- afx_msg void OnKillfocusTxtPrivatekeyfile();
- afx_msg void OnKillfocusTxtPublickeyfile();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
- //Utility functions
- void EnableControls();
- void PrepareEncryptionMethod( DXceedEncryption& xEncryptor );
- void LoadOption();
- void ReadKeyFile( LPCSTR sKeyFileName,
- DXceedEncryption* pxEncryptor,
- COleVariant* pvaKey );
- void SaveOption();
- void SaveEncryptionType();
- void SavePrivateKeyFileSetting();
- void SavePublicKeyFileSetting();
- CString SelectKeyFile();
-
- // The values chosen by the user in the Option form
- enuEncryptionMethod m_eEncryptionMethod;
- enuEncryptionMode m_eEncryptionMode;
- enuPaddingMethod m_ePaddingMethod;
- enuHashingMethod m_eHashingMethod;
- short m_nSecretKeySize;
- };
-
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
- #endif // !defined(AFX_MEMORYEncryptDLG_H__56170D64_79FA_432E_AB62_1CF8342F2B91__INCLUDED_)
-