Certificate management functions. More...
#include <string.h>#include <unistd.h>#include <assert.h>#include <libxml/tree.h>#include <sqlite3.h>#include <eurephia_nullsafe.h>#include <eurephia_context.h>#include <eurephia_log.h>#include <eurephia_xml.h>#include <eurephia_values.h>#include <eurephiadb_session_struct.h>#include <eurephiadb_mapping.h>#include <passwd.h>#include <eurephiadb_driver.h>#include "../sqlite.h"#include "../fieldmapping.h"
Include dependency graph for certificates.c:Go to the source code of this file.
Defines | |
| #define | FMAP_CERTS |
Functions | |
| static xmlDoc * | certificate_list (eurephiaCTX *ctx, eDBfieldMap *srch_map, const char *sortkeys) |
| static xmlDoc * | certificate_add (eurephiaCTX *ctx, eDBfieldMap *crtinf_map) |
| static xmlDoc * | certificate_delete (eurephiaCTX *ctx, eDBfieldMap *crtinf_map) |
| xmlDoc * | eDBadminCertificate (eurephiaCTX *ctx, xmlDoc *qryxml) |
Certificate management functions.
Definition in file certificates.c.
| #define FMAP_CERTS |
fieldmapping.h: Include declaration of tbl_sqlite_certs
Definition at line 55 of file certificates.c.
| static xmlDoc* certificate_add | ( | eurephiaCTX * | ctx, | |
| eDBfieldMap * | crtinf_map | |||
| ) | [static] |
Internal function. Registers a new certificate and saves it in the database
| ctx | eurephiaCTX | |
| crtinf_map | eDBfieldMap containing certificate info to be registered |
< Messages intended when debugging. Only for log level > 10
< The context is used via the eurephiadm console utility
< The context is used via a web based utility
< Alias for LOG_CRITICAL
< Operation failed and might have been aborted. Log level always 0
< Alias for LOG_FATAL
< Operation failed and cannot continue. Log level always < 2
Definition at line 136 of file certificates.c.
Here is the call graph for this function:
Here is the caller graph for this function:| static xmlDoc* certificate_delete | ( | eurephiaCTX * | ctx, | |
| eDBfieldMap * | crtinf_map | |||
| ) | [static] |
Internal function. Deletes one or more certificates from the database
| ctx | eurephiaCTX | |
| crtinf_map | eDBfieldMap with information about certificate(s) to delete |
< Messages intended when debugging. Only for log level > 10
< The context is used via the eurephiadm console utility
< The context is used via a web based utility
< Alias for LOG_CRITICAL
< Operation failed and might have been aborted. Log level always 0
< Alias for LOG_FATAL
< Operation failed and cannot continue. Log level always < 2
Definition at line 193 of file certificates.c.
Here is the call graph for this function:
Here is the caller graph for this function:| static xmlDoc* certificate_list | ( | eurephiaCTX * | ctx, | |
| eDBfieldMap * | srch_map, | |||
| const char * | sortkeys | |||
| ) | [static] |
Internal function. Retrieves info about one or more certificates
| ctx | eurephiaCTX | |
| srch_map | eDBfieldMap defining the query | |
| sortkeys | String containing the sort order of the fields |
< Messages intended when debugging. Only for log level > 10
< Alias for LOG_ERROR, in case it is not defined
< API errors but not sever, program can continue to run
Definition at line 69 of file certificates.c.
Here is the call graph for this function:
Here is the caller graph for this function:| xmlDoc* eDBadminCertificate | ( | eurephiaCTX * | ctx, | |
| xmlDoc * | qryxml | |||
| ) |
Function for listing, registering new or deleting certificates in the database
| ctx | eurephiaCTX | |
| qryxml | XML document with information about the operation |
Skeleton of an XML document used for eDBadminCertificate()
<eurephia format="1"> <certificates mode="{list|register|delete}"> <fieldMapping table="certificates"> <{field name}>{field value}</{field name}> ... <{field name}>{field value}</{field name}> </fieldMapping> [<sortkeys>{field name}[, {field name}...]</sortkeys>] </certificates> </eurephia>
Valid field names are: depth, digest, common_name, org, email and certid. For list and delete mode, all field names can be used to narrow the search query. In register mode all fields are required, except certid which must not be given.
The sortkeys tag will only be used in list mode, and it takes a list of comma separated field names.
Skeleton of a result document from a "list" mode query.
<eurephia format="1"> <certificates certificates={number of found certs}"> <certificate certid="{int}" depth="{int}" registered="{date+time}"> <digest>{SHA1 digest of cert}</digest> <common_name>{(CN) common name of cert}</common_name> <organisation>{(O) organisation name of cert}</organisation> <email>{(emailAddr) e-mail address found in cert}</email> </certificate> </certificates> </eurephia>
< Messages intended when debugging. Only for log level > 10
< The context is used via the eurephiadm console utility
< The context is used via a web based utility
< Alias for LOG_CRITICAL
< Operation failed and might have been aborted. Log level always 0
< Alias for LOG_CRITICAL
< Operation failed and might have been aborted. Log level always 0
< Alias for LOG_ERROR, in case it is not defined
< API errors but not sever, program can continue to run
< Alias for LOG_ERROR, in case it is not defined
< API errors but not sever, program can continue to run
< Alias for LOG_ERROR, in case it is not defined
< API errors but not sever, program can continue to run
Definition at line 236 of file certificates.c.
Here is the call graph for this function:
1.7.1