gm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gm-devel] Using AuthLoad class


From: Jesse Lovelace
Subject: [Gm-devel] Using AuthLoad class
Date: Fri, 28 Jun 2002 13:29:50 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020408

The AuthLoad class is broken into 4 files:

authload.h : holds all of the class declarations
authload.cpp : holds all functions for AuthLoad::
auth_user.cpp : holds all function defs. for the nested class AuthLoad::Users:: auth_global.cpp: holds all function defs. for nested class AuthLoad::Globals:: (currently does nothing) auth_contact.cpp: holds all function defs. for nested class AuthLoad::Contacts::

When you first create an authload object, you can specify a directory in the constructor. This is were authload will look for user configuration files. The default constructor looks in the directory that the program is ran from.

You may try to create a new user account by calling AuthLoad::CreateNew(string name, SecByteBlock password) this creates a new user acount by hex encoding the username and appending the extention ".kim" to the file, the file is encrypted with MARS in CBC_CTS mode using a hash (sha384) of the supplied password. The encryption also does an HMAC.

To try and login to an existing account, use Login(string name, SecByteBlock pword), the function will return true if that is a valid password/username.

(if you ran "CreateNew" you are already logged in)

To logout of that user, use Logoff();

To force a write to disk, call CommitToFile(); This is done anyway when the program closes or the user logs off.

To reset the password, call SetActivePassword(Sec..);

To access your contacts for this user, use the notation:

myAuthLoadObj.Contacts.MyContactsFunction();

ie:  if I wanted to add a contact,
myAuthLoadObj.Contacts.Add("jimbob");

or add a folder:
myAuthLoadObj.Contacts.AddFolder("my friends");

then you can move "jimbob" if you like:
myAuthLoadObj.Contacts.Move("jimbob", "my friends");


In this way you can add, subtract, move contacts and add an *unlimited* depth tree of folders/contacts. You can extract a XMLNode of all your contacts (in the form "<contacts><folder name = "my friends"><contact name="jimbob"/></folder></contacts>") via the:

myAuthLoadObj.Contacts.GetConfig();

The specifications of AuthLoad are, of course, not set in stone, so we may add/subtract functions to better use the system.


Jesse





reply via email to

[Prev in Thread] Current Thread [Next in Thread]