Defines | Functions

parse_certificate_files.c File Reference

Parses PEM/DER or PKCS#12 certificate files to retrieve information needed by eurephia. This feature requires OpenSSL to be available. More...

#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <openssl/ssl.h>
#include <openssl/pkcs12.h>
#include <openssl/evp.h>
#include <openssl/err.h>
#include <eurephia_nullsafe.h>
#include <certinfo.h>
#include "get_console_input.h"
#include "parse_certificate_files.h"
Include dependency graph for parse_certificate_files.c:

Go to the source code of this file.

Functions

char * ExtractCertInfo (const char *module, X509 *cert, const char *fieldname)
certinfo_Cert_ParseFile (const char *module, const char *certfile, int certfile_format)

Detailed Description

Parses PEM/DER or PKCS#12 certificate files to retrieve information needed by eurephia. This feature requires OpenSSL to be available.

Author:
David Sommerseth <dazo@users.sourceforge.net>
Date:
2008-12-21

Definition in file parse_certificate_files.c.


Function Documentation

certinfo* _Cert_ParseFile ( const char *  module,
const char *  certfile,
int  certfile_format 
)

Internal function, usually called via the Cert_ParseFile(...) macro. Parses a certificate file of a given format.

Parameters:
module String containing a module name, only used in error situations
certfile File name of the input file
certfile_format Certificate format of the file
Returns:
Returns a certinfo struct pointer with the parsed result on success, otherwise NULL.

< Input certificate is in PEM/DER format

< Input certificate is in PKCS#12 format

Definition at line 118 of file parse_certificate_files.c.

Here is the call graph for this function:

char* ExtractCertInfo ( const char *  module,
X509 *  cert,
const char *  fieldname 
)

Extracts a specific X.509 field from an X509 struct pointer.

Parameters:
module String containing a module name, only used in error situations
cert Pointer to an X509 struct with the certificate information
fieldname X.509 field name to extract
Returns:
Returns a string (char *) to the field value if found, otherwise NULL.

Definition at line 59 of file parse_certificate_files.c.

Here is the caller graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines