Browse CVS Repository
Contents of /tombo/Tombo/Src/PasswordManager.h
Parent Directory
| Revision Log
| Revision Graph
Revision 1.2 -
( show annotations)
( download)
( as text)
Fri Oct 15 20:27:27 2004 UTC
(19 years, 5 months ago)
by hirami
Branch: MAIN
CVS Tags: Tombo_2_0a3, Tombo_2_0a2, Tombo_2_0a1, Tombo_1_17_1, B191, B192, B193, B194, B196, B197, B198, B199, B200, B201, B202, B203, B205, B206, B207, B208, B183, B181, B180, B187, B186, B184, B189, B188, B213, B212, B211, B217, B216, B215, B214, B219, B218, Tombo_2_0b2, Tombo_2_0b3, Tombo_2_0b1, Tombo_2_0b4, B228, B229, B226, B227, B224, B225, B222, B223, B220, B221, B172, B173, B159, B171, Tombo_1_13, SNAPSHOT20051220, Tombo_1_12, B231, B230, Tombo_1_15, Tombo_1_14, Tombo_1_17, Tombo_1_16, B177, B174, B175, B178, B179, B164, B169, B168, B165, SNAPSHOT_20041121, B166, B161, B160, B163, B162, HEAD
Branch point for: Tombo_1_17_1_branch
Changes since 1.1: +6 -0 lines
File MIME type: text/x-chdr
* DEV:remove TreeViewItem::GetFolderPath
* DEV:Refactoring about update notes.
| 1 |
#ifndef PASSWORDMANAGER_H |
| 2 |
#define PASSWORDMANAGER_H |
| 3 |
|
| 4 |
// タイムアウトのチェック |
| 5 |
// |
| 6 |
// 電源ON フォアグラウンドの状態で放置 |
| 7 |
// 電源OFFにして放置 |
| 8 |
// 電源ON 他のアプリを起動して放置 |
| 9 |
|
| 10 |
|
| 11 |
////////////////////////////////////////////// |
| 12 |
// パスワードマネージャ |
| 13 |
////////////////////////////////////////////// |
| 14 |
// パスワードを管理する。 |
| 15 |
// アプリ起動後パスワード未入力の場合、ダイアログを表示してパスワードの入力を促す。 |
| 16 |
|
| 17 |
class PasswordManager { |
| 18 |
char *pPassword; |
| 19 |
|
| 20 |
HWND hParent; |
| 21 |
HINSTANCE hInstance; |
| 22 |
FILETIME ftLastAccess; |
| 23 |
|
| 24 |
public: |
| 25 |
PasswordManager() : pPassword(NULL), hParent(NULL), hInstance(NULL) {} |
| 26 |
~PasswordManager(); |
| 27 |
|
| 28 |
BOOL Init(HWND hParent, HINSTANCE hInstance); |
| 29 |
|
| 30 |
// 戻り値がNULLでbCancelがTRUEの場合、ユーザがキャンセルした |
| 31 |
// 暗号化の場合には再入力が必要となる。bEncrypt = TRUEとすること。 |
| 32 |
const char *Password(BOOL *bCancel, BOOL bEncrypt); |
| 33 |
|
| 34 |
// パスワードを記憶しているか |
| 35 |
BOOL IsRememberPassword() { return pPassword != NULL; } |
| 36 |
|
| 37 |
// パスワードの消去 |
| 38 |
void ForgetPassword(); |
| 39 |
|
| 40 |
// タイマによるパスワード消去用関数 |
| 41 |
void UpdateAccess(); |
| 42 |
void ForgetPasswordIfNotAccessed(); |
| 43 |
}; |
| 44 |
|
| 45 |
////////////////////////////////////////////// |
| 46 |
// パスワードFingerPrintの取得・確認 |
| 47 |
////////////////////////////////////////////// |
| 48 |
// pFpは32バイトのバッファ |
| 49 |
|
| 50 |
// FingerPrintは1バイトの識別子,16バイトのseedと16バイトの結果、計33バイトからなる。 |
| 51 |
// pFP[ 0] : 識別子(バージョン情報) |
| 52 |
// pFp[ 1]〜pFp[16] : seed |
| 53 |
// pFp[17]〜pFp[32] : 結果 |
| 54 |
|
| 55 |
BOOL GetFingerPrint(LPBYTE pFp, const char *pPassword); |
| 56 |
BOOL CheckFingerPrint(LPBYTE pFp, const char *pPassword); |
| 57 |
|
| 58 |
////////////////////////////////////////////// |
| 59 |
// global definitions |
| 60 |
////////////////////////////////////////////// |
| 61 |
|
| 62 |
extern PasswordManager *g_pPassManager; |
| 63 |
|
| 64 |
#endif |
| |