RSA Security logo

RSA BSAFE Cert-C
API Reference

certlog.h File Reference

This file defines the status log interface.

#include "basetype.h"
#include "service.h"

Go to the source code of this file.

Functions

int C_Log (CERTC_CTX ctx, int status, int statusType, char *sourceName, int sourceLine,...)
 Appends a new entry to the status log. More...


Function Documentation

int C_Log CERTC_CTX    ctx,
int    status,
int    statusType,
char *    sourceName,
int    sourceLine,
...   
;
 

Appends a new entry to the status log. If more than one status-log service provider is registered, the entry is appended to each of the service providers' logs. If no status-log service provider is registered, the function returns a 0 (zero) or the value of the status parameter, depending on the value of the status type.

Parameters:
ctx This input parameter points to an initialized Cert-C context.
status This input parameter contains the status code to report. For Cert-C errors, this is one of the E_* constants. If it is a propagated Crypto-C error, it is one of the BE_* constants. If the status code is a 0 (zero), no log entry is made, and a 0 (zero) is returned irrespective of the status type.
statusType This input parameter determines the severity of the status that is reported. Depending on the severity, a different message might be logged for a given status code. If the status type is ST_ERROR, C_Log() returns the status parameter as its return value. Otherwise, C_Log() returns 0 (zero). Valid values are as follows:

Status Type Description
ST_INFO Information
ST_WARNING Warning
ST_ERROR Error
sourceName This input parameter points to a NUL-terminated string giving the name of the source code file where C_Log() is called. (Use the standard ANSI-C constant "__FILE__" as the source name.)
sourceLine This input parameter indicates the line number in the source code file where C_Log() is called. (Use the standard ANSI-C macro "__LINE__" as the source line.)
... Depending on the status code and status type, additional parameters might be required to complete the status message. For example, the status code E_ALLOC requires an additional integer parameter. See the Cert-C Service Providers and the certc.msg file for any additional parameters required by the E_* status codes. These should not be language-dependent phrases that require translation. For example, they can be numbers, file names, or certificate subject names, but not strings like "Not Found."

Note: You can append the certc.msg file with your own error codes, status messages, etc. Use this C_Log() function to write these messages to the log file.
Returns:
If the status type is ST_ERROR, this function returns the same value as the status input parameter. If the status type is ST_WARNING or ST_INFO, the function returns 0 (zero).



RSA BSAFE® Cert-C 2.7 API Reference