Algorithm Class Reference

#include <alg.h>

Inheritance diagram for Algorithm:

Inheritance graph

Detailed Description

Base class for tracking algorithm errors and internal system states.

Usage notes:
  Use Algorithm::isErrorState() to determine if the CDK is in the hard error state
	i.e., if a crypto function has failed by returning a null or empty string.
  Use Algorithm::SetErrorState() to place the CDK into the hard error state.
	This method is used internally and is unlikely to be called by an application.

Recommendations for strict FIPS 140-1 compliance:
  All methods may be used by a FIPS 140-1 compliant application. There are
  no restrictions regarding the methods and functions defined in this file.


Public Types

 UNINIT = -1
 uninitialized
 INIT = 0
 initialized
 FINAL = 1
 final
enum  STATE {
  UNINIT = -1,
  INIT = 0,
  FINAL = 1
}
 Algorithm states. More...

Public Member Functions

 Algorithm ()
 Constructor.
virtual ~Algorithm ()
 Destructor.
void SetState (enum STATE st)
 Set this algorithm's state indicator.
int GetState (void) const
 Get this algorithm's state indicator.

Static Public Member Functions

static int isErrorState ()
 Predicate used to test the internal error state indicator.
static void SetErrorState (char *lpszMessage=0)
 Set internal error state indicator to true.


Member Enumeration Documentation

enum STATE

Algorithm states.

Enumerator:
UNINIT  uninitialized
INIT  initialized
FINAL  final


Constructor & Destructor Documentation

Algorithm (  ) 

Constructor.

Remarks:
Sets algorithm state indicator to UNIINIT.


Member Function Documentation

int GetState ( void   )  const

Get this algorithm's state indicator.

Returns:
the current algorithm state: UNINIT, INIT, or FINAL.
Remarks:
For internal use only. This function should not be called by an application.

static int isErrorState (  )  [static]

Predicate used to test the internal error state indicator.

Returns:
true, if the CDK is in the hard error state
false, if the CDK is not in the hard error state

static void SetErrorState ( char *  lpszMessage = 0  )  [static]

Set internal error state indicator to true.

Parameters:
lpszMessage pointer to associated error message
Remarks:
For internal use only. This function should not be called by an application.

void SetState ( enum STATE  st  ) 

Set this algorithm's state indicator.

Parameters:
st the new algorithm state: UNINIT, INIT, or FINAL.
Remarks:
For internal use only. This function should not be called by an application.


The documentation for this class was generated from the following file:
ISC Cryptographic Development Kit - User's Guide
ISC website
Questions? E-mail ISC technical support
Copyright© 2002-2006 Information Security Corp. All rights reserved.