code::W2Authorization Class Reference

List of all members.

Detailed Description

Lets WDSSII algorithms and processes control access to different sections of the program.

To use this class, construct an object using the name of your program and an AUTH_KEY macro like this:

        W2Authorization myAuth( "myprog", myprog_AUTH_KEY );
     

After constructing the object, call methods to get boolean and string attributes use those to control/configure your algorithm.

Author:
Lakshman
Version:
Id
code_W2Authorization.h,v 1.9 2009/06/02 20:17:40 lakshman Exp
See also:
TEAEncryption


Public Member Functions

 W2Authorization (const std::string &keyName, int key1, int key2, int key3, int key4) throw ( Exception )
 Note that you will not really pass 5 parameters to the constructor.
bool getBoolean (const std::string &optionName)
 getting the boolean of a string option will always return false
std::string getString (const std::string &optionName)
 if you try to get the string of an option that is boolean, you will get either "true" or "false"
void checkUserName () throw (Exception)
 convenience function to check the user name is allowed
void checkDomainName () throw (Exception)
 convenience function to check that the domain is authorized.
code::TimeInterval checkExpiryTime () throw (Exception)
 convenience function to check that authorization time is not expired.
void checkExecutableName () throw (Exception)
 convenience function to check that is a valid executable


Constructor & Destructor Documentation

code::W2Authorization::W2Authorization ( const std::string &  keyName,
int  key1,
int  key2,
int  key3,
int  key4 
) throw ( Exception )

Note that you will not really pass 5 parameters to the constructor.

You will instead use an AUTH_KEY macro:

       W2Authorization myAuth( "myprog", myprog_AUTH_KEY );
       

throws an exception if the configuration file could not be found or could not be properly decoded.


Member Function Documentation

void code::W2Authorization::checkDomainName (  )  throw (Exception)

convenience function to check that the domain is authorized.

void code::W2Authorization::checkExecutableName (  )  throw (Exception)

convenience function to check that is a valid executable

code::TimeInterval code::W2Authorization::checkExpiryTime (  )  throw (Exception)

convenience function to check that authorization time is not expired.

This method throws an exception if the authorization has expired. Otherwise, it returns the TimeInterval left to expiration

Returns:
negative time interval if the authorization never expires

void code::W2Authorization::checkUserName (  )  throw (Exception)

convenience function to check the user name is allowed

bool code::W2Authorization::getBoolean ( const std::string &  optionName  ) 

getting the boolean of a string option will always return false

std::string code::W2Authorization::getString ( const std::string &  optionName  ) 

if you try to get the string of an option that is boolean, you will get either "true" or "false"


Generated on Fri May 4 13:40:13 2012 for WDSS-IIw2 by  doxygen 1.4.7